fix: revert ZIP package build to simpler configuration #33
Workflow file for this run
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*' | |
branches: | |
- test-release-workflow | |
paths: | |
- '.github/workflows/release.yml' | |
jobs: | |
build: | |
# Skip actual release upload when testing | |
env: | |
IS_TEST: ${{ github.ref == 'refs/heads/test-release-workflow' }} | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Update Version | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
$version = "${{ github.ref_name }}".TrimStart('v') | |
# Update project file version | |
$projectFile = "NeatShift/NeatShift/NeatShift.csproj" | |
$content = Get-Content $projectFile | |
$content = $content -replace '<Version>.*</Version>', "<Version>$version</Version>" | |
Set-Content $projectFile $content | |
# Update Version.cs | |
$versionFile = "NeatShift/NeatShift/Version.cs" | |
$content = Get-Content $versionFile | |
$content = $content -replace 'public const string Current = ".*";', "public const string Current = `"$version`";" | |
Set-Content $versionFile $content | |
# Update app.manifest | |
$manifestFile = "NeatShift/NeatShift/app.manifest" | |
$content = Get-Content $manifestFile | |
$content = $content -replace 'version="[\d\.]+"', "version=`"$version.0`"" | |
Set-Content $manifestFile $content | |
- name: Build Single-File | |
run: | | |
cd NeatShift | |
dotnet restore NeatShift.sln | |
dotnet publish NeatShift.sln -c Release -r win-x64 --self-contained true ` | |
/p:PublishSingleFile=true ` | |
/p:EnableCompressionInSingleFile=true ` | |
/p:IncludeNativeLibrariesForSelfExtract=true ` | |
/p:IncludeAllContentForSelfExtract=true ` | |
/p:DebugType=None ` | |
/p:DebugSymbols=false ` | |
/p:UseAppHost=true ` | |
/p:SelfContained=true ` | |
/p:ResourceHandlingMode=ResourceFile | |
- name: Build ZIP Package | |
run: | | |
cd NeatShift | |
dotnet restore NeatShift.sln | |
dotnet publish NeatShift.sln -c Release -r win-x64 --self-contained true ` | |
/p:DebugType=None ` | |
/p:DebugSymbols=false | |
Compress-Archive -Path ./NeatShift/bin/Release/net6.0-windows/win-x64/publish/* -DestinationPath ./NeatShift/bin/Release/net6.0-windows/win-x64/NeatShift-Release.zip -Force | |
- name: Check File Sizes | |
if: env.IS_TEST == 'true' | |
run: | | |
Get-Item ./NeatShift/NeatShift/bin/Release/net6.0-windows/win-x64/publish/NeatShift.exe | Select-Object Name, Length | |
Get-Item ./NeatShift/NeatShift/bin/Release/net6.0-windows/win-x64/NeatShift-Release.zip | Select-Object Name, Length | |
# Upload test builds as artifacts | |
- name: Upload Test Builds | |
if: env.IS_TEST == 'true' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: NeatShift-TestBuild | |
path: | | |
./NeatShift/NeatShift/bin/Release/net6.0-windows/win-x64/publish/NeatShift.exe | |
./NeatShift/NeatShift/bin/Release/net6.0-windows/win-x64/NeatShift-Release.zip | |
retention-days: 5 | |
# Create Release | |
- name: Create Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ github.ref_name }} | |
body: | | |
## Changes in this release | |
- Fixed resource handling in single-file build | |
- Improved icon handling | |
- Better XAML resource management | |
files: | | |
./NeatShift/NeatShift/bin/Release/net6.0-windows/win-x64/publish/NeatShift.exe | |
./NeatShift/NeatShift/bin/Release/net6.0-windows/win-x64/NeatShift-Release.zip |