Skip to content

Commit 4cc424e

Browse files
committed
exclude windows code sign
1 parent 71d7e03 commit 4cc424e

1 file changed

Lines changed: 32 additions & 44 deletions

File tree

.github/workflows/ci-main.yml

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010

1111
jobs:
1212
build:
13+
environment: codesign
14+
permissions:
15+
contents: read
16+
id-token: write
1317
strategy:
1418
fail-fast: false
1519
matrix:
@@ -91,50 +95,34 @@ jobs:
9195
apple-team-id: ${{ secrets.CODESIGN_DARWIN_APPLE_TEAM_ID }}
9296
app-path: |-
9397
./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
138126
- name: Package
139127
if: matrix.os != 'linux'
140128
run: go run mage.go package

0 commit comments

Comments
 (0)