|
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 | build: |
| 13 | + environment: codesign |
| 14 | + permissions: |
| 15 | + contents: read |
| 16 | + id-token: write |
13 | 17 | strategy: |
14 | 18 | fail-fast: false |
15 | 19 | matrix: |
@@ -91,50 +95,34 @@ jobs: |
91 | 95 | apple-team-id: ${{ secrets.CODESIGN_DARWIN_APPLE_TEAM_ID }} |
92 | 96 | app-path: |- |
93 | 97 | ./tmp/machbase-neo |
94 | | - - name: Codesign windows app |
95 | | - if: matrix.os == 'windows' |
96 | | - shell: pwsh |
97 | | - env: |
98 | | - CODESIGN_WIN_CERTIFICATE: ${{ secrets.CODESIGN_WIN_CERTIFICATE }} |
99 | | - CODESIGN_WIN_PASS: ${{ secrets.CODESIGN_WIN_PASS }} |
100 | | - run: | |
101 | | - $pfxPath = Join-Path $env:RUNNER_TEMP 'codesign.pfx' |
102 | | - try { |
103 | | - $certificateBase64 = $env:CODESIGN_WIN_CERTIFICATE ` |
104 | | - -replace '-----BEGIN CERTIFICATE-----', '' ` |
105 | | - -replace '-----END CERTIFICATE-----', '' ` |
106 | | - -replace '\s', '' |
107 | | -
|
108 | | - [System.IO.File]::WriteAllBytes( |
109 | | - $pfxPath, |
110 | | - [System.Convert]::FromBase64String($certificateBase64) |
111 | | - ) |
112 | | -
|
113 | | - $signtool = Get-ChildItem 'C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe' | |
114 | | - Sort-Object FullName -Descending | |
115 | | - Select-Object -First 1 -ExpandProperty FullName |
116 | | -
|
117 | | - if (-not $signtool) { |
118 | | - throw 'signtool.exe not found' |
119 | | - } |
120 | | -
|
121 | | - & $signtool sign ` |
122 | | - /f $pfxPath ` |
123 | | - /p $env:CODESIGN_WIN_PASS ` |
124 | | - /tr http://timestamp.digicert.com ` |
125 | | - /td sha256 ` |
126 | | - /fd sha256 ` |
127 | | - './tmp/machbase-neo.exe' |
128 | | -
|
129 | | - if ($LASTEXITCODE -ne 0) { |
130 | | - throw "signtool.exe failed with exit code $LASTEXITCODE" |
131 | | - } |
132 | | - } |
133 | | - finally { |
134 | | - if (Test-Path $pfxPath) { |
135 | | - Remove-Item $pfxPath -Force |
136 | | - } |
137 | | - } |
| 98 | + # - name: Azure login for code signing |
| 99 | + # if: matrix.os == 'windows' |
| 100 | + # uses: azure/login@v3 |
| 101 | + # with: |
| 102 | + # client-id: ${{ secrets.AZURE_CLIENT_ID }} |
| 103 | + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
| 104 | + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
| 105 | + # - name: Codesign windows app |
| 106 | + # if: matrix.os == 'windows' |
| 107 | + # uses: azure/artifact-signing-action@v2 |
| 108 | + # with: |
| 109 | + # endpoint: ${{ vars.AZURE_ARTIFACT_SIGNING_ENDPOINT }} |
| 110 | + # signing-account-name: ${{ vars.AZURE_ARTIFACT_SIGNING_ACCOUNT }} |
| 111 | + # certificate-profile-name: ${{ vars.AZURE_ARTIFACT_SIGNING_CERT_PROFILE }} |
| 112 | + # files: ${{ github.workspace }}\tmp\machbase-neo.exe |
| 113 | + # file-digest: SHA256 |
| 114 | + # timestamp-rfc3161: http://timestamp.acs.microsoft.com |
| 115 | + # timestamp-digest: SHA256 |
| 116 | + # exclude-environment-credential: true |
| 117 | + # exclude-workload-identity-credential: true |
| 118 | + # exclude-managed-identity-credential: true |
| 119 | + # exclude-shared-token-cache-credential: true |
| 120 | + # exclude-visual-studio-credential: true |
| 121 | + # exclude-visual-studio-code-credential: true |
| 122 | + # exclude-azure-cli-credential: false |
| 123 | + # exclude-azure-powershell-credential: true |
| 124 | + # exclude-azure-developer-cli-credential: true |
| 125 | + # exclude-interactive-browser-credential: true |
138 | 126 | - name: Package |
139 | 127 | if: matrix.os != 'linux' |
140 | 128 | run: go run mage.go package |
|
0 commit comments