Publish #30
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: Publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| type: string | |
| required: true | |
| description: "Version to publish (YYYY.mDD)" | |
| env: | |
| build-output: build-output | |
| permissions: | |
| packages: read | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| environment: release | |
| strategy: | |
| matrix: | |
| arch: [win-x64, win-arm64] | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| OUTPUT_FILENAME: kaplan-${{ matrix.arch }}.exe | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Setup NuGet | |
| run: dotnet nuget add source --username github --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/dragonfruitnetwork/index.json" | |
| - name: NuGet Restore | |
| run: | | |
| dotnet restore | |
| dotnet tool install --global nuget-license | |
| - name: Generate licences.txt | |
| run: nuget-license -i DragonFruit.Kaplan\DragonFruit.Kaplan.csproj -o Table > DragonFruit.Kaplan\Assets\licences.txt | |
| continue-on-error: true | |
| - name: Build | |
| run: dotnet publish -c Release -r ${{ matrix.arch }} -p:Version=${{ inputs.version }} --self-contained -o ${{ env.build-output }} DragonFruit.Kaplan\DragonFruit.Kaplan.csproj | |
| - name: Sign | |
| env: | |
| certificateContents: ${{ secrets.DRAGONFRUIT_CERT_CONTENTS }} | |
| certificatePassword: ${{ secrets.DRAGONFRUIT_CERT_PASSWORD }} | |
| run: | | |
| echo $env:certificateContents > $env:USERPROFILE\dragonfruit.pfx.b64 | |
| certutil -decode $env:USERPROFILE\dragonfruit.pfx.b64 $env:USERPROFILE\dragonfruit.pfx | |
| $signTool = Join-Path -Path ${env:ProgramFiles(x86)} -ChildPath "Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe" | |
| & $signTool sign /f $env:USERPROFILE\dragonfruit.pfx /p $env:certificatePassword /fd SHA256 /td SHA256 /tr http://timestamp.digicert.com /as /v ${{ env.build-output }}\DragonFruit.Kaplan.exe | |
| - name: Dual-sign (new cert) | |
| env: | |
| certificateContents: ${{ secrets.DRAGONFRUIT_CERT_2026 }} | |
| certificatePassword: ${{ secrets.DRAGONFRUIT_CERT_2026_PASSWORD }} | |
| run: | | |
| echo $env:certificateContents > $env:USERPROFILE\dragonfruit2.pfx.b64 | |
| certutil -decode $env:USERPROFILE\dragonfruit.pfx.b64 $env:USERPROFILE\dragonfruit2.pfx | |
| $signTool = Join-Path -Path ${env:ProgramFiles(x86)} -ChildPath "Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe" | |
| & $signTool sign /as /f $env:USERPROFILE\dragonfruit2.pfx /p $env:certificatePassword /fd SHA256 /td SHA256 /tr http://timestamp.digicert.com /as /v ${{ env.build-output }}\DragonFruit.Kaplan.exe | |
| - name: Rename Executable | |
| run: | | |
| Rename-Item -Path ${{ env.build-output }}\DragonFruit.Kaplan.exe -NewName $env:OUTPUT_FILENAME | |
| - name: Upload Artifact | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| make_latest: true | |
| generate_release_notes: true | |
| tag_name: ${{ inputs.version }} | |
| files: ${{ env.build-output }}/${{ env.OUTPUT_FILENAME }} |