Skip to content

Commit 7c92484

Browse files
authored
Code-sign ark binaries on Windows (#985)
* code-sign ark binaries on windows * we only need build_windows here * remove unused DEBUG_FLAG
1 parent d748867 commit 7c92484

File tree

1 file changed

+47
-5
lines changed

1 file changed

+47
-5
lines changed

.github/workflows/release-windows.yml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818

1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21-
DEBUG_FLAG: ${{ matrix.flavor == 'debug' && '-debug' || '' }}
2221

2322
strategy:
2423
matrix:
@@ -45,17 +44,60 @@ jobs:
4544
cargo clean
4645
cargo build ${{ matrix.flavor == 'release' && '--release' || '' }} --target ${{ matrix.rust_target_prefix }}-pc-windows-msvc
4746
48-
- name: Create archive
47+
- name: Upload unsigned executable for signing
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: ark-${{ matrix.flavor }}-windows-${{ matrix.arch }}-unsigned
51+
path: target\${{ matrix.rust_target_prefix }}-pc-windows-msvc\${{ matrix.flavor }}\ark.exe
52+
53+
sign_windows:
54+
name: "Sign Windows Binaries"
55+
uses: posit-dev/posit-gh-actions/.github/workflows/sign-windows.yml@main
56+
needs: [build_windows]
57+
secrets: inherit
58+
strategy:
59+
matrix:
60+
arch: [x64, arm64]
61+
flavor: [debug, release]
62+
with:
63+
unsigned_artifact_name: ark-${{ matrix.flavor }}-windows-${{ matrix.arch }}-unsigned
64+
signed_artifact_name: ark-${{ matrix.flavor }}-windows-${{ matrix.arch }}-signed
65+
66+
repackage_signed_windows:
67+
name: Repackage Signed Windows Binaries
68+
runs-on: windows-latest
69+
needs: [sign_windows]
70+
timeout-minutes: 10
71+
72+
env:
73+
DEBUG_FLAG: ${{ matrix.flavor == 'debug' && '-debug' || '' }}
74+
75+
strategy:
76+
matrix:
77+
arch: [x64, arm64]
78+
flavor: [debug, release]
79+
80+
steps:
81+
- name: Checkout sources
82+
uses: actions/checkout@v4
83+
84+
- name: Download signed executable
85+
uses: actions/download-artifact@v4
86+
with:
87+
name: ark-${{ matrix.flavor }}-windows-${{ matrix.arch }}-signed
88+
path: signed
89+
90+
- name: Create signed archive
4991
shell: pwsh
5092
run: |
51-
# Compress the kernel to an archive
93+
# Compress the signed kernel to an archive
5294
$params = @{
53-
Path = "target\${{ matrix.rust_target_prefix }}-pc-windows-msvc\${{ matrix.flavor }}\ark.exe", "LICENSE", "crates\ark\NOTICE"
95+
Path = "signed\ark.exe", "LICENSE", "crates\ark\NOTICE"
5496
DestinationPath = "ark-${{ inputs.version }}${{ env.DEBUG_FLAG }}-windows-${{ matrix.arch }}.zip"
5597
}
5698
Compress-Archive @params
5799
58-
- name: Upload client archive
100+
- name: Upload signed archive
59101
uses: actions/upload-artifact@v4
60102
with:
61103
name: ark-${{ matrix.flavor }}-windows-${{ matrix.arch }}-archive

0 commit comments

Comments
 (0)