Release #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
workflow_dispatch: | |
inputs: | |
is_manual: | |
description: 'Manual release (keeps current version)' | |
type: boolean | |
default: true | |
required: true | |
permissions: | |
contents: write | |
packages: read # for package dependencies | |
actions: read # for checking out code | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Setup .NET | |
uses: actions/[email protected] | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
working-directory: ./NeatShift | |
run: dotnet restore NeatShift.sln | |
- name: Build | |
working-directory: ./NeatShift | |
run: dotnet build NeatShift.sln --configuration Release --no-restore | |
- name: Publish | |
working-directory: ./NeatShift | |
run: | | |
dotnet publish "NeatShift/NeatShift.csproj" -c Release -r win-x64 ` | |
--self-contained true ` | |
-p:PublishSingleFile=true ` | |
-p:EnableCompressionInSingleFile=true ` | |
-p:IncludeNativeLibrariesForSelfExtract=true ` | |
-p:DebugType=None ` | |
-p:DebugSymbols=false ` | |
-p:PublishReadyToRun=true ` | |
-p:PublishTrimmed=false ` | |
-p:ApplicationManifest=app.manifest ` | |
-p:WindowsPackageType=None ` | |
-p:IncludeAllContentForSelfExtract=true ` | |
-o ../publish | |
- name: Copy exe to release | |
run: Copy-Item "publish/NeatShift.exe" -Destination "NeatShift.exe" | |
- name: Create Runtime Config | |
run: | | |
Set-Content -Path "publish/NeatShift.runtimeconfig.json" -Value '{ | |
"runtimeOptions": { | |
"tfm": "net6.0-windows", | |
"framework": { | |
"name": "Microsoft.WindowsDesktop.App", | |
"version": "6.0.0" | |
}, | |
"configProperties": { | |
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false | |
} | |
} | |
}' | |
- name: Zip Release with Config | |
run: Compress-Archive -Path "publish/*" -DestinationPath "NeatShift-Release.zip" | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: | | |
NeatShift.exe | |
NeatShift-Release.zip | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
tag_name: ${{ github.ref_name }} # Use existing tag for manual releases |