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

Windows release sign #52

Merged
merged 33 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
dc3cbfd
test with win gh action
marcopiraccini Dec 3, 2023
3319d72
test with win gh action
marcopiraccini Dec 3, 2023
9a7447a
test with win gh action
marcopiraccini Dec 3, 2023
755201b
test with win gh action
marcopiraccini Dec 3, 2023
33eb20d
test with win gh action
marcopiraccini Dec 3, 2023
830b4d1
test with win gh action
marcopiraccini Dec 3, 2023
3b3e37b
test with win gh action
marcopiraccini Dec 3, 2023
8f37d3a
test with win gh action
marcopiraccini Dec 3, 2023
17003bc
test with win gh action
marcopiraccini Dec 3, 2023
b54850d
test with win gh action
marcopiraccini Dec 3, 2023
192b7de
test with win gh action
marcopiraccini Dec 3, 2023
8f01b51
test with win gh action
marcopiraccini Dec 3, 2023
7ffc226
test with win gh action
marcopiraccini Dec 3, 2023
fcfc7b3
test with win gh action
marcopiraccini Dec 3, 2023
ff52bd5
test with win gh action
marcopiraccini Dec 3, 2023
c6fe924
test with win gh action
marcopiraccini Dec 3, 2023
b022f25
test with win gh action
marcopiraccini Dec 3, 2023
e41ea75
test with win gh action
marcopiraccini Dec 3, 2023
76ffbfc
test with win gh action
marcopiraccini Dec 3, 2023
1c0b42e
test with win gh action
marcopiraccini Dec 3, 2023
bef933b
test with win gh action
marcopiraccini Dec 3, 2023
3c9e793
test with win gh action
marcopiraccini Dec 3, 2023
f52c79c
test with win gh action
marcopiraccini Dec 3, 2023
f332228
test with win gh action
marcopiraccini Dec 3, 2023
23c0451
test with win gh action
marcopiraccini Dec 3, 2023
59c09d7
removed smctl healthcheck
marcopiraccini Dec 3, 2023
601f6b1
renamed gh action workflow
marcopiraccini Dec 3, 2023
0b66796
uses GH env correctly
marcopiraccini Dec 3, 2023
1b41a78
uses GH env correctly
marcopiraccini Dec 3, 2023
4a1012c
tirgger the tests first
marcopiraccini Dec 3, 2023
cd1cc25
tirgger the tests first
marcopiraccini Dec 3, 2023
79e531e
trigger the tests first
marcopiraccini Dec 3, 2023
4c6746b
trigger the tests first
marcopiraccini Dec 3, 2023
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
97 changes: 97 additions & 0 deletions .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: release-draft

on:
workflow_dispatch:
workflow_call:
push:
# branches:
# - main

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
run-test:
uses: platformatic/meraki/.github/workflows/test.yml@main

release-linux:
needs: run-test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm run build:linux
- run: npm run release:linux

release-windows:
needs: run-test
runs-on: windows-latest
timeout-minutes: 15
env:
DIGICERT_FINGERPRINT: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
SM_HOST: ${{ secrets.SM_HOST }}
SM_API_KEY: ${{ secrets.SM_API_KEY }}
SM_CLIENT_CERT_FILE: D:\\Certificate_pkcs12.p12
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
steps:
- name: Set up certificate
run: |
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
shell: bash

- name: Set variables
id: variables
run: |
dir
echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
echo "::set-output name=CERTIFICATE_NAME::gt-certificate"
echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH
echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
shell: bash

- name: Setup Keylocker KSP on windows
run: |
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o Keylockertools-windows-x64.msi
msiexec /i Keylockertools-windows-x64.msi /quiet /qn
smksp_registrar.exe list
smctl.exe keypair ls
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
shell: cmd

- name: Certificates Sync
run: |
smctl windows certsync
shell: cmd

- name: SMCTL healthcheck
run: |
smctl healthcheck
shell: cmd

- uses: actions/setup-node@v3
with:
node-version: 18

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- run: npm ci
- run: npm run build:win
- run: npm run release:win

release-mac:
needs: run-test
runs-on: macos-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm run build
- run: npm run release:mac

49 changes: 0 additions & 49 deletions .github/workflows/release.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/releases.yml

This file was deleted.

2 changes: 1 addition & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ asarUnpack:
win:
executableName: meraki
icon: build/icon.png
sign: ./sign-win/sign-win.js
sign: ./sign-win.js
nsis:
artifactName: ${productName}-${version}-setup.${ext}
shortcutName: ${productName}
Expand Down
24 changes: 24 additions & 0 deletions sign-win.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// This is a callback that can be used to sign the executable on Windows.
// See: https://www.electron.build/configuration/win
// We are using this callback instead of the electron-builder built-in mechanism
// because we want to use the DigiCert signing tool to sign the executable.
// See also: https://docs.digicert.com/en/digicert-keylocker/sign-with-digicert-signing-tools/sign-with-smctl.html
exports.default = async function (configuration) {
const { execa } = await import('execa')
console.log('Signing: ', configuration.path)
const execPath = configuration.path
const { stdout, exitCode } = await execa('smctl', [
'sign',
'--fingerprint',
process.env.DIGICERT_FINGERPRINT,
'--input',
execPath
])
// `smctl` returns exit code 0 even if the signing fails :(. )
// So we need to check the output for errors.
// See also: https://docs.digicert.com/en/digicert-keylocker/sign-with-digicert-signing-tools/sign-with-smctl.html
if (stdout.includes('FAILED')) {
console.error('Signing failed:', stdout, exitCode)
throw new Error(stdout)
}
}
1 change: 0 additions & 1 deletion sign-win/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions sign-win/hardwareToken.cfg

This file was deleted.

Binary file removed sign-win/jsign-5.0.jar
Binary file not shown.
18 changes: 0 additions & 18 deletions sign-win/sign-win.js

This file was deleted.

Loading