updated nugets, removed web api #102
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: Create release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-windows: | |
| name: Build Windows | |
| runs-on: windows-latest | |
| outputs: | |
| version_nodots: ${{ steps.get_version.outputs.version_nodots }} | |
| version_dotted: ${{ steps.get_version.outputs.version_dotted }} | |
| if: ${{ github.event_name == 'push' && contains(github.event.head_commit.message, '[release]') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Publish (Windows) | |
| shell: pwsh | |
| run: | | |
| dotnet publish ".\src\Avalonia.Desktop\Avalonia.Desktop.csproj" -p:PublishProfile=Windows -c Release -o ./publish | |
| - name: Get version | |
| id: get_version | |
| shell: pwsh | |
| run: | | |
| $exe = Join-Path $PWD 'publish\Superheater.exe' | |
| if (-not (Test-Path $exe)) { Write-Error "Executable not found: $exe" } | |
| $version = (Get-Item $exe).VersionInfo.FileVersion | |
| $withDots = $version.Substring(0,$version.Length-2) | |
| $withoutDots = $withDots.Replace('.','') | |
| echo "version_dotted=$withDots" >> $env:GITHUB_OUTPUT | |
| echo "version_nodots=$withoutDots" >> $env:GITHUB_OUTPUT | |
| - name: Upload unsigned Windows artifact | |
| id: upload-unsigned-artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: publish/Superheater.exe | |
| - name: Signing | |
| uses: signpath/github-action-submit-signing-request@v1 | |
| with: | |
| api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' | |
| organization-id: 'ff1c1d90-ad84-4e5e-9b3e-41ea2f786aae' | |
| project-slug: 'Steam-Superheater' | |
| signing-policy-slug: 'release-signing' | |
| github-artifact-id: '${{ steps.upload-unsigned-artifact.outputs.artifact-id }}' | |
| wait-for-completion: true | |
| output-artifact-directory: 'publish/signed/' | |
| artifact-configuration-slug: 'zip' | |
| - name: Zip Windows build | |
| shell: pwsh | |
| run: | | |
| ls .\publish\signed\ | |
| $v = "${{ steps.get_version.outputs.version_nodots }}" | |
| $dest = Join-Path $PWD "publish\signed\superheater_${v}_win-x64.zip" | |
| if (Test-Path $dest) { Remove-Item $dest } | |
| Compress-Archive -Path ".\publish\signed\Superheater.exe" -DestinationPath $dest | |
| Write-Host "Created $dest" | |
| - name: Upload signed Windows artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: superheater-win | |
| path: publish/signed/superheater_${{ steps.get_version.outputs.version_nodots }}_win-x64.zip | |
| build-linux: | |
| name: Build Linux | |
| runs-on: ubuntu-latest | |
| needs: build-windows | |
| if: ${{ github.event_name == 'push' && contains(github.event.head_commit.message, '[release]') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Publish (Linux) | |
| run: | | |
| dotnet publish "./src/Avalonia.Desktop/Avalonia.Desktop.csproj" -p:PublishProfile=Linux -c Release -o ./publish | |
| - name: Zip Linux build (use version from Windows job) | |
| run: | | |
| VERSION="${{ needs.build-windows.outputs.version_nodots }}" | |
| mkdir -p publish | |
| if [ ! -d "./publish/Superheater" ] && [ ! -f "./publish/Superheater" ]; then | |
| echo "ERROR: Expected linux publish output at ./publish/Superheater" | |
| ls -la ./publish || true | |
| exit 1 | |
| fi | |
| DEST="./publish/superheater_${VERSION}_linux-x64.zip" | |
| rm -f "$DEST" | |
| if [ -d "./publish/Superheater" ]; then | |
| (cd publish && zip -r "../publish/superheater_${VERSION}_linux-x64.zip" "Superheater") | |
| else | |
| (cd publish && zip -r "../publish/superheater_${VERSION}_linux-x64.zip" "Superheater") | |
| fi | |
| echo "Created $DEST" | |
| - name: Upload Linux artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: superheater-linux | |
| path: publish/superheater_${{ needs.build-windows.outputs.version_nodots }}_linux-x64.zip | |
| release: | |
| name: Create release | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-windows | |
| - build-linux | |
| if: ${{ github.event_name == 'push' && contains(github.event.head_commit.message, '[release]') }} | |
| steps: | |
| - name: Download Windows artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: superheater-win | |
| path: publish/signed | |
| - name: Download Linux artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: superheater-linux | |
| path: publish | |
| - name: Create release (and upload assets) | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ needs.build-windows.outputs.version_dotted}} | |
| name: v${{ needs.build-windows.outputs.version_dotted }} | |
| body: | | |
| Automated release created by GitHub Actions. | |
| artifacts: publish/**/*.zip | |
| draft: false | |
| prerelease: true |