|
38 | 38 | required: false |
39 | 39 | default: "" |
40 | 40 | type: string |
| 41 | + windows-signing: |
| 42 | + description: "Whether to perform Windows signing via Azure Trusted Signing" |
| 43 | + required: false |
| 44 | + default: false |
| 45 | + type: boolean |
41 | 46 | cli-run-id: |
42 | 47 | description: > |
43 | 48 | Run ID of a prior build-cli.yml workflow run to download the goose |
@@ -125,7 +130,7 @@ jobs: |
125 | 130 |
|
126 | 131 | - name: Cache Rust dependencies |
127 | 132 | if: inputs.cli-run-id == '' |
128 | | - uses: Swatinem/rust-cache@v2 |
| 133 | + uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 |
129 | 134 | with: |
130 | 135 | key: goose2-macos-arm64 |
131 | 136 |
|
@@ -175,13 +180,11 @@ jobs: |
175 | 180 | certificate-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} |
176 | 181 |
|
177 | 182 | # ── Tauri bundle ── |
178 | | - - name: Check disk space before bundle |
179 | | - run: df -h |
180 | | - |
181 | 183 | - name: Bundle Goose 2 (pnpm tauri build) |
182 | 184 | env: |
| 185 | + APPLE_SIGNING_IDENTITY: ${{ inputs.signing && 'Developer ID Application' || '' }} |
183 | 186 | APPLE_ID: ${{ inputs.signing && secrets.APPLE_ID || '' }} |
184 | | - APPLE_ID_PASSWORD: ${{ inputs.signing && secrets.APPLE_ID_PASSWORD || '' }} |
| 187 | + APPLE_PASSWORD: ${{ inputs.signing && secrets.APPLE_ID_PASSWORD || '' }} |
185 | 188 | APPLE_TEAM_ID: ${{ inputs.signing && secrets.APPLE_TEAM_ID || '' }} |
186 | 189 | working-directory: ui/goose2 |
187 | 190 | run: | |
@@ -291,7 +294,7 @@ jobs: |
291 | 294 |
|
292 | 295 | - name: Cache Rust dependencies |
293 | 296 | if: inputs.cli-run-id == '' |
294 | | - uses: Swatinem/rust-cache@v2 |
| 297 | + uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 |
295 | 298 | with: |
296 | 299 | key: goose2-macos-x86_64 |
297 | 300 |
|
@@ -360,8 +363,9 @@ jobs: |
360 | 363 | # ── Tauri bundle (cross-compile for Intel) ── |
361 | 364 | - name: Bundle Goose 2 for Intel |
362 | 365 | env: |
| 366 | + APPLE_SIGNING_IDENTITY: ${{ inputs.signing && 'Developer ID Application' || '' }} |
363 | 367 | APPLE_ID: ${{ inputs.signing && secrets.APPLE_ID || '' }} |
364 | | - APPLE_ID_PASSWORD: ${{ inputs.signing && secrets.APPLE_ID_PASSWORD || '' }} |
| 368 | + APPLE_PASSWORD: ${{ inputs.signing && secrets.APPLE_ID_PASSWORD || '' }} |
365 | 369 | APPLE_TEAM_ID: ${{ inputs.signing && secrets.APPLE_TEAM_ID || '' }} |
366 | 370 | working-directory: ui/goose2 |
367 | 371 | run: | |
@@ -477,7 +481,7 @@ jobs: |
477 | 481 |
|
478 | 482 | - name: Cache Rust dependencies |
479 | 483 | if: inputs.cli-run-id == '' |
480 | | - uses: Swatinem/rust-cache@v2 |
| 484 | + uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 |
481 | 485 | with: |
482 | 486 | key: goose2-linux-x86_64 |
483 | 487 |
|
@@ -564,6 +568,7 @@ jobs: |
564 | 568 | runs-on: windows-latest |
565 | 569 | timeout-minutes: 60 |
566 | 570 | permissions: |
| 571 | + id-token: write |
567 | 572 | contents: read |
568 | 573 | actions: read |
569 | 574 | steps: |
@@ -621,7 +626,7 @@ jobs: |
621 | 626 |
|
622 | 627 | - name: Cache Rust dependencies |
623 | 628 | if: inputs.cli-run-id == '' |
624 | | - uses: Swatinem/rust-cache@v2 |
| 629 | + uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 |
625 | 630 | with: |
626 | 631 | key: goose2-windows-x86_64 |
627 | 632 |
|
@@ -697,3 +702,70 @@ jobs: |
697 | 702 | name: Goose2-windows-x64-msi |
698 | 703 | path: ui/goose2/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi |
699 | 704 | if-no-files-found: warn |
| 705 | + |
| 706 | + sign-windows: |
| 707 | + name: "Sign Windows installers" |
| 708 | + needs: bundle-windows |
| 709 | + if: inputs.windows-signing |
| 710 | + runs-on: windows-latest |
| 711 | + environment: signing |
| 712 | + permissions: |
| 713 | + id-token: write |
| 714 | + contents: read |
| 715 | + actions: read |
| 716 | + steps: |
| 717 | + - name: Download NSIS installer |
| 718 | + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 |
| 719 | + with: |
| 720 | + name: Goose2-windows-x64-nsis |
| 721 | + path: unsigned/nsis |
| 722 | + |
| 723 | + - name: Download MSI installer |
| 724 | + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 |
| 725 | + with: |
| 726 | + name: Goose2-windows-x64-msi |
| 727 | + path: unsigned/msi |
| 728 | + |
| 729 | + - name: Azure login |
| 730 | + uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2 |
| 731 | + with: |
| 732 | + client-id: ${{ secrets.AZURE_CLIENT_ID }} |
| 733 | + tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
| 734 | + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
| 735 | + |
| 736 | + - name: Sign Windows installers with Azure Trusted Signing |
| 737 | + uses: azure/trusted-signing-action@db7a3a6bd3912025c705162fb7475389f5b69ec6 # v1 |
| 738 | + with: |
| 739 | + endpoint: ${{ secrets.AZURE_SIGNING_ENDPOINT }} |
| 740 | + trusted-signing-account-name: ${{ secrets.AZURE_SIGNING_ACCOUNT_NAME }} |
| 741 | + certificate-profile-name: ${{ secrets.AZURE_CERTIFICATE_PROFILE_NAME }} |
| 742 | + files-folder: ${{ github.workspace }}/unsigned |
| 743 | + files-folder-filter: exe,msi |
| 744 | + files-folder-recurse: true |
| 745 | + |
| 746 | + - name: Verify signed installers |
| 747 | + shell: pwsh |
| 748 | + run: | |
| 749 | + $files = Get-ChildItem -Path unsigned -Recurse -Include *.exe,*.msi |
| 750 | + foreach ($file in $files) { |
| 751 | + Write-Output "Verifying signature: $($file.FullName)" |
| 752 | + $sig = Get-AuthenticodeSignature $file.FullName |
| 753 | + if ($sig.Status -ne "Valid") { |
| 754 | + throw "Signature invalid for $($file.Name): $($sig.Status)" |
| 755 | + } |
| 756 | + Write-Output "✅ Signature valid: $($file.Name)" |
| 757 | + } |
| 758 | +
|
| 759 | + - name: Upload signed NSIS installer |
| 760 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 |
| 761 | + with: |
| 762 | + name: Goose2-windows-x64-nsis-signed |
| 763 | + path: unsigned/nsis/*.exe |
| 764 | + if-no-files-found: error |
| 765 | + |
| 766 | + - name: Upload signed MSI installer |
| 767 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 |
| 768 | + with: |
| 769 | + name: Goose2-windows-x64-msi-signed |
| 770 | + path: unsigned/msi/*.msi |
| 771 | + if-no-files-found: error |
0 commit comments