Target .NET 10; ship framework-dependent + self-contained builds #45
Workflow file for this run
This file contains hidden or 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: build | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: build (${{ matrix.rid }}) | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - rid: win-x64 | |
| runner: windows-latest | |
| - rid: win-arm64 | |
| runner: windows-11-arm | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET 10 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore | |
| run: dotnet restore -r ${{ matrix.rid }} | |
| - name: Build (Release) | |
| run: dotnet build --configuration Release --no-restore -r ${{ matrix.rid }} | |
| # Framework-dependent: small (~25 MB) but needs the .NET 10 Desktop Runtime. | |
| - name: Publish (framework-dependent) | |
| run: dotnet publish WinLens.csproj -c Release -r ${{ matrix.rid }} --self-contained false -p:PublishSingleFile=true -o publish-fd | |
| # Self-contained: larger (~75 MB) but runs with no runtime install. | |
| - name: Publish (self-contained) | |
| run: dotnet publish WinLens.csproj -c Release -r ${{ matrix.rid }} --self-contained true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -o publish-sc | |
| - name: Rename self-contained artifact | |
| shell: pwsh | |
| run: Rename-Item publish-sc/WinLens.exe "WinLens-${{ matrix.rid }}-standalone.exe" | |
| - name: Upload framework-dependent artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: WinLens-${{ matrix.rid }} | |
| path: publish-fd/WinLens.exe | |
| - name: Upload self-contained artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: WinLens-${{ matrix.rid }}-standalone | |
| path: publish-sc/WinLens-${{ matrix.rid }}-standalone.exe |