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
10 changed files with 34 additions and 89 deletions

View File

@ -10,7 +10,8 @@ on:
- 'nightly-v[0-9]+.[0-9]+.[0-9]+' - 'nightly-v[0-9]+.[0-9]+.[0-9]+'
env: 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') }} IS_NIGHTLY: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'nightly-v') }}
concurrency: concurrency:
@ -99,11 +100,11 @@ jobs:
yarn files:set-version yarn files:set-version
yarn files:flip-to-nightly yarn files:flip-to-nightly
- name: Set release version # - name: Set release version
if: ${{ env.IS_RELEASE == 'true' }} # if: ${{ env.IS_RELEASE == 'true' }}
run: | # run: |
export VERSION=${GITHUB_REF_NAME#v} # export VERSION=${GITHUB_REF_NAME#v}
yarn files:set-version # yarn files:set-version
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
@ -183,30 +184,32 @@ jobs:
max_attempts: 3 max_attempts: 3
command: yarn install 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) - name: Prepare certificate and variables (Windows only)
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }} if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
run: | run: |
echo "${{secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12 CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12
cat /d/Certificate_pkcs12.p12 echo "$SM_CLIENT_CERT_FILE_B64" | base64 --decode > $CERTIFICATE_PATH
echo "::set-output name=version::${GITHUB_REF#refs/tags/v}" echo "SM_CLIENT_CERT_FILE=$CERTIFICATE_PATH" >> "$GITHUB_ENV"
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV" echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$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 "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)\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 (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 shell: bash
- name: Setup certicate with SSM KSP (Windows only) - name: Setup certicate with SSM KSP (Windows only)
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }} if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
run: | 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 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 smtools-windows-x64.msi /quiet /qn msiexec /i Keylockertools-windows-x64.msi /quiet /qn
smksp_registrar.exe list smksp_registrar.exe list
smctl.exe keypair ls smctl.exe keypair ls
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
smksp_cert_sync.exe smksp_cert_sync.exe
smctl windows certsync
shell: cmd shell: cmd
- name: Build the app (debug) - name: Build the app (debug)
@ -225,8 +228,8 @@ jobs:
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }} CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }} 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 # TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
uses: nick-fields/retry@v3.0.2 uses: nick-fields/retry@v3.0.2
with: with:

View File

@ -99,6 +99,7 @@ export class HomePageFixture {
createAndGoToProject = async (projectTitle = 'untitled') => { createAndGoToProject = async (projectTitle = 'untitled') => {
await this.projectsLoaded() await this.projectsLoaded()
await this.projectButtonNew.click() await this.projectButtonNew.click()
await this.projectTextName.click()
await this.projectTextName.fill(projectTitle) await this.projectTextName.fill(projectTitle)
await this.projectButtonContinue.click() await this.projectButtonContinue.click()
} }

View File

@ -230,12 +230,16 @@ export class SceneFixture {
await expect(this.networkToggleConnected).toBeVisible({ timeout }) await expect(this.networkToggleConnected).toBeVisible({ timeout })
} }
settled = async (cmdBar?: CmdBarFixture) => { settled = async (cmdBar: CmdBarFixture) => {
const u = await getUtils(this.page) const u = await getUtils(this.page)
await expect(this.startEditSketchBtn).not.toBeDisabled({ timeout: 15_000 }) await expect(this.startEditSketchBtn).not.toBeDisabled()
await expect(this.startEditSketchBtn).toBeVisible() await expect(this.startEditSketchBtn).toBeVisible()
await cmdBar.openCmdBar()
await cmdBar.chooseCommand('Settings · app · show debug panel')
await cmdBar.selectOption({ name: 'on' }).click()
await u.openDebugPanel() await u.openDebugPanel()
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel() await u.closeDebugPanel()

View File

@ -68,10 +68,12 @@ test.describe('edit with AI example snapshots', () => {
body1CapCoords.x, body1CapCoords.x,
body1CapCoords.y body1CapCoords.y
) )
const yellow: [number, number, number] = [179, 179, 131]
const submittingToast = page.getByText('Submitting to Text-to-CAD API...') const submittingToast = page.getByText('Submitting to Text-to-CAD API...')
await test.step('wait for scene to load select body and check selection came through', async () => { await test.step('wait for scene to load select body and check selection came through', async () => {
await clickBody1Cap() await clickBody1Cap()
await scene.expectPixelColor(yellow, body1CapCoords, 20)
await editor.expectState({ await editor.expectState({
highlightedCode: '', highlightedCode: '',
activeLines: ['|>startProfileAt([-73.64,-42.89],%)'], activeLines: ['|>startProfileAt([-73.64,-42.89],%)'],

View File

@ -588,7 +588,6 @@ test(
'Draft circle should look right', 'Draft circle should look right',
{ tag: '@snapshot' }, { tag: '@snapshot' },
async ({ page, context, cmdBar, scene }) => { async ({ page, context, cmdBar, scene }) => {
test.fixme(orRunWhenFullSuiteEnabled())
const u = await getUtils(page) const u = await getUtils(page)
await page.setViewportSize({ width: 1200, height: 500 }) await page.setViewportSize({ width: 1200, height: 500 })
const PUR = 400 / 37.5 //pixeltoUnitRatio const PUR = 400 / 37.5 //pixeltoUnitRatio

View File

@ -1,15 +0,0 @@
import { createProject } from '@e2e/playwright/test-utils'
import { test } from '@e2e/playwright/zoo-test'
test.describe('Stress test', () => {
test('Create project and load stress test', async ({
cmdBar,
scene,
page,
}, testInfo) => {
const projectName = 'stress-test-project'
// Create and load project
await createProject({ name: projectName, page })
await scene.settled(cmdBar)
})
})

View File

@ -33,10 +33,12 @@ win:
- x64 - x64
- arm64 - arm64
signtoolOptions: signtoolOptions:
sign: "./scripts/sign-win.js" certificateSha1: F4C9A52FF7BC26EE5E054946F6B11DEEA94C748D
signingHashAlgorithms: signingHashAlgorithms:
- sha256 - 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" icon: "assets/icon.ico"
fileAssociations: fileAssociations:
- ext: kcl - 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)
}
}

View File

@ -14,7 +14,6 @@ import {
commandBarActor, commandBarActor,
useCommandBarState, useCommandBarState,
} from '@src/machines/commandBarMachine' } from '@src/machines/commandBarMachine'
import toast from 'react-hot-toast'
export const COMMAND_PALETTE_HOTKEY = 'mod+k' export const COMMAND_PALETTE_HOTKEY = 'mod+k'
@ -36,23 +35,13 @@ export const CommandBar = () => {
commandBarActor.send({ type: 'Close' }) commandBarActor.send({ type: 'Close' })
}, [pathname]) }, [pathname])
/**
* if the engine connection is about to end, we don't want users
* to be able to perform commands that might require that connection,
* so we just close the command palette.
* TODO: instead, let each command control whether it is disabled, and
* don't just bail out
*/
useEffect(() => { useEffect(() => {
if ( if (
!commandBarActor.getSnapshot().matches('Closed') && immediateState.type !== EngineConnectionStateType.ConnectionEstablished
(immediateState.type === EngineConnectionStateType.Disconnecting ||
immediateState.type === EngineConnectionStateType.Disconnected)
) { ) {
commandBarActor.send({ type: 'Close' }) commandBarActor.send({ type: 'Close' })
toast.error('Exiting command flow because engine disconnected')
} }
}, [immediateState, commandBarActor]) }, [immediateState])
// Hook up keyboard shortcuts // Hook up keyboard shortcuts
useHotkeyWrapper([COMMAND_PALETTE_HOTKEY], () => { useHotkeyWrapper([COMMAND_PALETTE_HOTKEY], () => {

View File

@ -3,7 +3,6 @@ import { faBugSlash } from '@fortawesome/free-solid-svg-icons'
import type { MouseEventHandler, ReactNode } from 'react' import type { MouseEventHandler, ReactNode } from 'react'
import type { ContextFrom } from 'xstate' import type { ContextFrom } from 'xstate'
import { IS_PLAYWRIGHT_KEY } from '@e2e/playwright/storageStates'
import type { CustomIconName } from '@src/components/CustomIcon' import type { CustomIconName } from '@src/components/CustomIcon'
import { import {
FileTreeInner, FileTreeInner,
@ -242,8 +241,6 @@ export const sidebarPanes: SidebarPane[] = [
) )
}, },
keybinding: 'Shift + D', keybinding: 'Shift + D',
hide: ({ settings }) => hide: ({ settings }) => !settings.app.showDebugPanel.current,
!(window?.localStorage.getItem(IS_PLAYWRIGHT_KEY) === 'true') &&
!settings.app.showDebugPanel.current,
}, },
] ]