Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign Windows with new action. #2717

Merged
merged 7 commits into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ on:
required: false
type: boolean
default: false
sign-windows:
description: "Sign Windows executables"
required: false
type: boolean
default: false
build-arm-macos:
description: "Build ARM macOS executables"
required: false
Expand Down Expand Up @@ -907,7 +912,9 @@ jobs:
sign_windows:
runs-on: windows-latest
needs: [combine]
if: (github.event_name == 'release' || startsWith(github.event.inputs.do-release, 'v'))
if: (github.event_name == 'release' ||
startsWith(github.event.inputs.do-release, 'v') ||
github.event.inputs.sign-windows == 'true')
steps:
- uses: actions/checkout@v4

Expand All @@ -920,23 +927,17 @@ jobs:
& "C:\Program Files\Git\bin\bash.exe" --noprofile --norc -e -o pipefail -c "tar -xzf toit-windows.tar.gz"

- name: Sign Windows binary
uses: toitlang/action-code-sign@5da128f4fb4f719c1b667867815f6c31e743b111 # v1.1.0
uses: toitlang/action-sign-server@bb64e1973f5492ace732c9a08c76d2777b102dc1 # v1.0.6
with:
certificate: ${{ secrets.DIGICERT_CERTIFICATE }}
api-key: ${{ secrets.DIGICERT_API_KEY }}
certificate-password: ${{ secrets.DIGICERT_PASSWORD }}
certificate-fingerprint: ${{ secrets.DIGICERT_FINGERPRINT }}
keypair-alias: ${{ vars.DIGICERT_KEYPAIR_ALIAS }}
uri: ${{ vars.CERTUM_URI }}
password: ${{ secrets.CERTUM_PWD }}
path: toit/bin

- name: Sign Windows tools
uses: toitlang/action-code-sign@5da128f4fb4f719c1b667867815f6c31e743b111 # v1.1.0
uses: toitlang/action-sign-server@bb64e1973f5492ace732c9a08c76d2777b102dc1 # v1.0.6
with:
certificate: ${{ secrets.DIGICERT_CERTIFICATE }}
api-key: ${{ secrets.DIGICERT_API_KEY }}
certificate-password: ${{ secrets.DIGICERT_PASSWORD }}
certificate-fingerprint: ${{ secrets.DIGICERT_FINGERPRINT }}
keypair-alias: ${{ vars.DIGICERT_KEYPAIR_ALIAS }}
uri: ${{ vars.CERTUM_URI }}
password: ${{ secrets.CERTUM_PWD }}
path: toit/tools

- name: Compress
Expand All @@ -947,7 +948,11 @@ jobs:
id: version
shell: powershell
run: |
$versionV = "${{ env.TOIT_VERSION }}"
# If the version is empty, use 'v0.0.0' instead.
if ([string]::IsNullOrEmpty($env:TOIT_VERSION)) {
echo "TOIT_VERSION=v0.0.0" >> $env:GITHUB_ENV
}
$versionV = $env:TOIT_VERSION
$version = $versionV.Substring(1)
echo "version=$version" >> $env:GITHUB_OUTPUT

Expand All @@ -956,13 +961,10 @@ jobs:
& tools\windows_installer\build.bat ${{ steps.version.outputs.version }} $PWD\toit $PWD\toit-windows-x64-installer.exe

- name: Sign Windows installer
uses: toitlang/action-code-sign@5da128f4fb4f719c1b667867815f6c31e743b111 # v1.1.0
uses: toitlang/action-sign-server@bb64e1973f5492ace732c9a08c76d2777b102dc1 # v1.0.6
with:
certificate: ${{ secrets.DIGICERT_CERTIFICATE }}
api-key: ${{ secrets.DIGICERT_API_KEY }}
certificate-password: ${{ secrets.DIGICERT_PASSWORD }}
certificate-fingerprint: ${{ secrets.DIGICERT_FINGERPRINT }}
keypair-alias: ${{ vars.DIGICERT_KEYPAIR_ALIAS }}
uri: ${{ vars.CERTUM_URI }}
password: ${{ secrets.CERTUM_PWD }}
path: toit-windows-x64-installer.exe

- name: Upload artifacts
Expand Down
Loading