Compare commits

...

28 Commits

Author SHA1 Message Date
e8a82ea85e Clean up for PR 2025-04-11 09:47:45 -04:00
c1894edaed Remove sha1, add rfc3161TimeStampServer 2025-04-11 08:40:24 -04:00
8c28f34238 Back to publisherName = certificateSubjectName = KittyCAD Inc 2025-04-11 07:40:38 -04:00
d2340628a8 WIP 2025-04-11 07:05:22 -04:00
a1f5cdd690 Update signingHashAlgorithms to include sha1 2025-04-11 05:18:56 -04:00
d1d8d0a82c Use smctl windows certsync to update the windows store in build-apps (attempt) 2025-04-11 05:03:33 -04:00
f76b328136 WIP messing with Get-ChildItem -Recurse Cert 2025-04-11 04:59:45 -04:00
a13548da17 WIP messing with Get-ChildItem -Recurse Cert 2025-04-11 04:55:18 -04:00
65f4b0f239 WIP messing with Get-ChildItem -Recurse Cert 2025-04-11 04:54:05 -04:00
dbcc0bd3b4 WIP messing with Get-ChildItem -Recurse Cert 2025-04-11 04:43:35 -04:00
472b3618ac shell: pwsh 2025-04-11 04:00:47 -04:00
43e89e8bae Add back smksp_registrar.exe list and smctl.exe keypair ls 2025-04-10 19:39:56 -04:00
94a9e01301 Add certificateSha1 2025-04-10 19:02:01 -04:00
3980a1caf8 WIP 2025-04-10 18:58:46 -04:00
d4f23f8469 Trying to follow https://github.com/electron-userland/electron-builder/issues/7605#issuecomment-2257861622 2025-04-10 18:55:46 -04:00
9143c6f08a Test from https://github.com/electron-userland/electron-builder/issues/7605#issuecomment-2257861622 2025-04-10 18:49:23 -04:00
1d4456c458 Loosing my mind 2025-04-10 18:39:13 -04:00
c6fbb4fc63 Fix typo 2025-04-10 18:36:17 -04:00
b7c8d6c185 Copied line by line from docs in dummy script 2025-04-10 17:58:48 -04:00
f23aa5e642 Add dummy pierre-test-windows-code-sign, plus console log on normal script 2025-04-10 17:36:34 -04:00
8bb26c9b89 Remove stdio param for hopefully more logs 2025-04-10 16:56:54 -04:00
0d7aebdee9 DEBUG=electron-builder to get more logs (maybe) 2025-04-10 16:40:11 -04:00
ad333c2055 Try certutil.exe -csp "DigiCert Software Trust Manager KSP", forget yarn cache for now 2025-04-10 16:25:12 -04:00
3559df0c5e Add smksp_registrar.exe register which is somewhere else in their docs. Plus comment 2025-04-10 16:00:53 -04:00
e2dda07829 Update from docs, back to inherit 2025-04-10 15:33:19 -04:00
ea585cb5d6 Trying to get more logs 2025-04-10 15:04:18 -04:00
8af9af2aa7 Another try with the right things commented out 2025-04-10 14:22:30 -04:00
f0ba35c0b2 WIP: Updater on Nightly on Windows failed
Fixes #6256
2025-04-10 14:09:55 -04:00
3 changed files with 22 additions and 54 deletions

View File

@ -10,7 +10,8 @@ on:
- 'nightly-v[0-9]+.[0-9]+.[0-9]+'
env:
IS_RELEASE: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
# IS_RELEASE: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
IS_RELEASE: true
IS_NIGHTLY: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'nightly-v') }}
concurrency:
@ -99,11 +100,11 @@ jobs:
yarn files:set-version
yarn files:flip-to-nightly
- name: Set release version
if: ${{ env.IS_RELEASE == 'true' }}
run: |
export VERSION=${GITHUB_REF_NAME#v}
yarn files:set-version
# - name: Set release version
# if: ${{ env.IS_RELEASE == 'true' }}
# run: |
# export VERSION=${GITHUB_REF_NAME#v}
# yarn files:set-version
- uses: actions/upload-artifact@v4
with:
@ -183,30 +184,32 @@ jobs:
max_attempts: 3
command: yarn install
# Next steps are from Digicert docs at
# https://docs.digicert.com/en/digicert-keylocker/ci-cd-integrations/scripts/github/scripts-for-signing-using-ksp-library-on-github.html#ksp-signing-using-github-action-488726
- name: Prepare certificate and variables (Windows only)
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
run: |
echo "${{secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
cat /d/Certificate_pkcs12.p12
echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12
echo "$SM_CLIENT_CERT_FILE_B64" | base64 --decode > $CERTIFICATE_PATH
echo "SM_CLIENT_CERT_FILE=$CERTIFICATE_PATH" >> "$GITHUB_ENV"
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV"
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 One Signing Manager Tools" >> $GITHUB_PATH
echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
shell: bash
- name: Setup certicate with SSM KSP (Windows only)
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
run: |
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o smtools-windows-x64.msi
msiexec /i smtools-windows-x64.msi /quiet /qn
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
smksp_cert_sync.exe
smctl windows certsync
shell: cmd
- name: Build the app (debug)
@ -225,8 +228,8 @@ jobs:
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
DEBUG: "electron-notarize*"
# DEBUG: "electron-notarize*"
DEBUG: electron-builder
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
uses: nick-fields/retry@v3.0.2
with:

View File

@ -33,10 +33,12 @@ win:
- x64
- arm64
signtoolOptions:
sign: "./scripts/sign-win.js"
certificateSha1: F4C9A52FF7BC26EE5E054946F6B11DEEA94C748D
signingHashAlgorithms:
- sha256
publisherName: "KittyCAD Inc" # needs to be exactly like on Digicert
publisherName: "KittyCAD Inc"
certificateSubjectName: "KittyCAD Inc"
rfc3161TimeStampServer: http://timestamp.digicert.com
icon: "assets/icon.ico"
fileAssociations:
- ext: kcl

View File

@ -1,37 +0,0 @@
// From https://github.com/OpenBuilds/OpenBuilds-CONTROL/blob/4800540ffaa517925fc2cff26670809efa341ffe/signWin.js
const { execSync } = require('node:child_process')
exports.default = async (configuration) => {
if (!process.env.SM_API_KEY) {
console.error(
'Signing using signWin.js script: failed: SM_API_KEY ENV VAR NOT FOUND'
)
return
}
if (!process.env.WINDOWS_CERTIFICATE_THUMBPRINT) {
console.error(
'Signing using signWin.js script: failed: FINGERPRINT ENV VAR NOT FOUND'
)
return
}
if (!configuration.path) {
throw new Error(
`Signing using signWin.js script: failed: TARGET PATH NOT FOUND`
)
}
try {
execSync(
`smctl sign --fingerprint="${process.env.WINDOWS_CERTIFICATE_THUMBPRINT
}" --input "${String(configuration.path)}"`,
{
stdio: 'inherit',
}
)
console.log('Signing using signWin.js script: successful')
} catch (error) {
throw new Error('Signing using signWin.js script: failed:', error)
}
}