Create Release (Windows) #104
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: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Extract Version | |
| run: | | |
| $content = Get-Content "CHANGELOG.md" -Raw | |
| if ($content -match "#### Version\s+([\d.]+)") { | |
| $version = $matches[1] | |
| Write-Host "Version: $version" | |
| echo "VERSION=$version" >> $env:GITHUB_ENV | |
| } else { | |
| Write-Error "Could not find version in CHANGELOG.md" | |
| exit 1 | |
| } | |
| - name: Clean | |
| run: dotnet clean | |
| - name: Publish WPF App | |
| run: | | |
| dotnet publish Wabbajack.App.Wpf\Wabbajack.App.Wpf.csproj ` | |
| --framework "net9.0-windows" ` | |
| --runtime win-x64 ` | |
| --configuration Release ` | |
| /p:Platform=x64 ` | |
| -o publish\app ` | |
| /p:IncludeNativeLibrariesForSelfExtract=true ` | |
| --self-contained ` | |
| /p:DebugType=embedded | |
| - name: Publish Launcher | |
| run: | | |
| dotnet publish Wabbajack.Launcher\Wabbajack.Launcher.csproj ` | |
| --framework "net9.0-windows" ` | |
| --runtime win-x64 ` | |
| --configuration Release ` | |
| /p:Platform=x64 ` | |
| -o publish\launcher ` | |
| /p:PublishSingleFile=true ` | |
| /p:IncludeNativeLibrariesForSelfExtract=true ` | |
| --self-contained ` | |
| /p:DebugType=embedded | |
| - name: Publish CLI | |
| run: | | |
| dotnet publish Wabbajack.CLI\Wabbajack.CLI.csproj ` | |
| --framework "net9.0" ` | |
| --runtime win-x64 ` | |
| --configuration Release ` | |
| /p:Platform=x64 ` | |
| -o publish\app\cli ` | |
| /p:IncludeNativeLibrariesForSelfExtract=true ` | |
| --self-contained ` | |
| /p:DebugType=embedded | |
| # Install SignPath PowerShell module | |
| - name: Install SignPath Module | |
| shell: pwsh | |
| run: Install-Module -Name SignPath -Force -Scope CurrentUser | |
| # Sign the executables using SignPath PowerShell module | |
| - name: Sign Wabbajack.exe (Main App) | |
| shell: pwsh | |
| env: | |
| SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_KEY }} | |
| SIGNPATH_ORG_ID: ${{ secrets.SIGNPATH_ORG_ID }} | |
| run: | | |
| Submit-SigningRequest ` | |
| -InputArtifactPath "publish\app\Wabbajack.exe" ` | |
| -ApiToken $env:SIGNPATH_API_TOKEN ` | |
| -OrganizationId $env:SIGNPATH_ORG_ID ` | |
| -ProjectSlug "wabbajack" ` | |
| -SigningPolicySlug "test-signing" ` | |
| -OutputArtifactPath "publish\app\Wabbajack.exe" ` | |
| -WaitForCompletion ` | |
| -Force | |
| - name: Sign wabbajack-cli.exe | |
| shell: pwsh | |
| env: | |
| SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_KEY }} | |
| SIGNPATH_ORG_ID: ${{ secrets.SIGNPATH_ORG_ID }} | |
| run: | | |
| Submit-SigningRequest ` | |
| -InputArtifactPath "publish\app\cli\wabbajack-cli.exe" ` | |
| -ApiToken $env:SIGNPATH_API_TOKEN ` | |
| -OrganizationId $env:SIGNPATH_ORG_ID ` | |
| -ProjectSlug "wabbajack" ` | |
| -SigningPolicySlug "test-signing" ` | |
| -OutputArtifactPath "publish\app\cli\wabbajack-cli.exe" ` | |
| -WaitForCompletion ` | |
| -Force | |
| - name: Sign Wabbajack.exe (Launcher) | |
| shell: pwsh | |
| env: | |
| SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_KEY }} | |
| SIGNPATH_ORG_ID: ${{ secrets.SIGNPATH_ORG_ID }} | |
| run: | | |
| Submit-SigningRequest ` | |
| -InputArtifactPath "publish\launcher\Wabbajack.exe" ` | |
| -ApiToken $env:SIGNPATH_API_TOKEN ` | |
| -OrganizationId $env:SIGNPATH_ORG_ID ` | |
| -ProjectSlug "wabbajack" ` | |
| -SigningPolicySlug "test-signing" ` | |
| -OutputArtifactPath "publish\launcher\Wabbajack.exe" ` | |
| -WaitForCompletion ` | |
| -Force | |
| - name: Verify Signatures | |
| shell: pwsh | |
| run: | | |
| Write-Host "Checking signatures..." | |
| Get-AuthenticodeSignature "publish\app\Wabbajack.exe" | Format-List | |
| Get-AuthenticodeSignature "publish\app\cli\wabbajack-cli.exe" | Format-List | |
| Get-AuthenticodeSignature "publish\launcher\Wabbajack.exe" | Format-List | |
| - name: Create App ZIP | |
| run: | | |
| & "C:\Program Files\7-Zip\7z.exe" a publish\wabbajack-${{ env.VERSION }}.zip publish\app\* | |
| - name: Create Launcher ZIP | |
| run: | | |
| & "C:\Program Files\7-Zip\7z.exe" a publish\wabbajack-launcher-${{ env.VERSION }}.zip publish\launcher\* | |
| - name: Upload App Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wabbajack-app | |
| path: publish\wabbajack-${{ env.VERSION }}.zip | |
| retention-days: 30 | |
| - name: Upload Launcher Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wabbajack-launcher | |
| path: publish\wabbajack-launcher-${{ env.VERSION }}.zip | |
| retention-days: 30 |