Skip to content

fix: properly handle resources in single-file application #26

fix: properly handle resources in single-file application

fix: properly handle resources in single-file application #26

Workflow file for this run

name: Release
on:
release:
types: [created]
# Add testing trigger for our test branch
push:
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: 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 `
/p:UseAppHost=true `
/p:IncludeNativeLibrariesForSelfExtract=true `
/p:ResourceHandlingMode=ResourceFile
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
- name: Upload Release Assets
if: env.IS_TEST != 'true'
uses: softprops/action-gh-release@v1
with:
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