Skip to content

Commit 7275bdf

Browse files
committed
Add action to sign .exe
1 parent c5ee91b commit 7275bdf

2 files changed

Lines changed: 66 additions & 10 deletions

File tree

.github/workflows/cd.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and sign .exe
2+
3+
on:
4+
workflow_dispatch
5+
6+
jobs:
7+
build:
8+
name: Build .exe
9+
runs-on: windows-latest
10+
permissions:
11+
contents: write
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.13"
18+
- name: Install dependencies
19+
run: python -m pip install --upgrade pip
20+
- name: Install Open Pectus Engine Manager
21+
run: pip install -e ".[development]"
22+
- name: Build .exe
23+
run: |
24+
pyinstaller pyinstaller.spec
25+
cd dist
26+
move "Open Pectus Engine Manager.exe" ../
27+
- name: Install DigiCert Client tools from Github Custom Actions marketplace
28+
id: Digicert Code Signing Snippet
29+
uses: digicert/ssm-code-signing@v1.0.0
30+
- name: Set up certificate
31+
run: |
32+
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
33+
shell: bash
34+
- name: Set variables
35+
id: variables
36+
run: |
37+
echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
38+
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
39+
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$GITHUB_ENV"
40+
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
41+
echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV"
42+
shell: bash
43+
- name: Signing using certificate fingerprint
44+
run: |
45+
smctl sign --fingerprint ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }} --input "Open Pectus Engine Manager.exe" --config-file C:\Users\RUNNER~1\AppData\Local\Temp\smtools-windows-x64\pkcs11properties.cfg
46+
shell: cmd
47+
- uses: ncipollo/release-action@v1
48+
with:
49+
artifacts: "Open Pectus Engine Manager.exe"
50+
tag: release
51+
body: "Download and run `Open Pectus Engine Manager.exe`."
52+
allowUpdates: true
53+
makeLatest: true
54+
omitBodyDuringUpdate: true
55+
removeArtifacts: true
56+
replacesArtifacts: true
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ jobs:
3131
pyinstaller pyinstaller.spec
3232
cd dist
3333
move "Open Pectus Engine Manager.exe" ../
34-
- uses: ncipollo/release-action@v1
35-
with:
36-
artifacts: "Open Pectus Engine Manager.exe"
37-
tag: release
38-
body: "Download and run `Open Pectus Engine Manager.exe`."
39-
allowUpdates: true
40-
makeLatest: true
41-
omitBodyDuringUpdate: true
42-
removeArtifacts: true
43-
replacesArtifacts: true
34+
# - uses: ncipollo/release-action@v1
35+
# with:
36+
# artifacts: "Open Pectus Engine Manager.exe"
37+
# tag: release
38+
# body: "Download and run `Open Pectus Engine Manager.exe`."
39+
# allowUpdates: true
40+
# makeLatest: true
41+
# omitBodyDuringUpdate: true
42+
# removeArtifacts: true
43+
# replacesArtifacts: true

0 commit comments

Comments
 (0)