Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

feat: github actions notarization

Gabriel Stein7c94ec64954a
diff --git a/.github/workflows/build-and-notarize.yml b/.github/workflows/build-and-notarize.yml
new file mode 100644
index 000000000..9bcbefa68
--- /dev/null
+++ b/.github/workflows/build-and-notarize.yml
@@ -0,0 +1,93 @@
+name: Build and Notarize
+
+on:
+ push:
+ branches: [ main, develop ]
+ pull_request:
+ branches: [ main ]
+ workflow_dispatch:
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ include:
+ - os: ubuntu-latest
+ build_cmd: npm run build:linux
+ - os: windows-latest
+ build_cmd: npm run build:win
+ - os: macos-latest
+ build_cmd: npm run build:mac
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+ cache: 'npm'
+
+ - name: Install dependencies
+ run: npm ci
+
+ # macOS code signing setup - industry standard approach
+ - name: Setup macOS Code Signing
+ if: matrix.os == 'macos-latest' && github.event_name != 'pull_request'
+ env:
+ APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
+ APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
+ APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
+ run: |
+ # Create temp directory for certificates
+ CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
+ API_KEY_PATH=$RUNNER_TEMP/api_key.p8
+ KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
+
+ # Decode certificates from secrets
+ echo "$APPLE_CERTIFICATE_BASE64" | base64 --decode > $CERTIFICATE_PATH
+ echo "$APPLE_API_KEY_BASE64" | base64 --decode > $API_KEY_PATH
+
+ # Create temporary keychain
+ security create-keychain -p "runner" $KEYCHAIN_PATH
+ security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
+ security unlock-keychain -p "runner" $KEYCHAIN_PATH
+
+ # Import certificate to keychain
+ security import $CERTIFICATE_PATH -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
+ security list-keychain -d user -s $KEYCHAIN_PATH
+
+ # Allow codesign to use the certificate
+ security set-key-partition-list -S apple-tool:,apple: -s -k "runner" $KEYCHAIN_PATH
+
+ # Export API key path for electron-builder
+ echo "APPLE_API_KEY_PATH=$API_KEY_PATH" >> $GITHUB_ENV
+
+ - name: Build Application
+ run: ${{ matrix.build_cmd }}
+ env:
+ GH_TOKEN: ${{ secrets.GH_TOKEN }}
+ # Enable signing only for macOS non-PR builds
+ CSC_IDENTITY_AUTO_DISCOVERY: ${{ matrix.os == 'macos-latest' && github.event_name != 'pull_request' && 'true' || 'false' }}
+ # Notarization credentials (only used on macOS)
+ APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
+ APPLE_API_KEY_ISSUER_ID: ${{ secrets.APPLE_API_KEY_ISSUER_ID }}
+ APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
+
+ - name: Upload Artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: ${{ matrix.os }}-build
+ path: dist/
+ retention-days: 7
+
+ # Security cleanup - always run
+ - name: Cleanup Certificates
+ if: always() && matrix.os == 'macos-latest' && github.event_name != 'pull_request'
+ run: |
+ security delete-keychain $RUNNER_TEMP/app-signing.keychain-db || true
+ rm -f $RUNNER_TEMP/build_certificate.p12
+ rm -f $RUNNER_TEMP/api_key.p8
\ No newline at end of file
diff --git a/scripts/notarize.js b/scripts/notarize.js
index 91c026c9e..dada91fe9 100644
--- a/scripts/notarize.js
+++ b/scripts/notarize.js
@@ -4,27 +4,47 @@ const path = require('path');
exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
+ // Only notarize macOS builds
if (electronPlatformName !== 'darwin') {
return;
}
+ // Skip if signing is disabled
+ if (process.env.CSC_IDENTITY_AUTO_DISCOVERY === 'false') {
+ console.log('Skipping notarization (signing disabled)');
+ return;
+ }
+
const appName = context.packager.appInfo.productFilename;
const appPath = path.join(appOutDir, `${appName}.app`);
- console.log('Notarizing using keychain profile: openwispr-profile');
- console.log('Submitting app for notarization...');
+ console.log('Starting notarization...');
try {
- const result = await notarize({
+ // Use API key if available (CI/CD), otherwise use keychain (local)
+ const useApiKey = process.env.APPLE_API_KEY_ID && process.env.APPLE_API_KEY_ISSUER_ID;
+
+ await notarize({
tool: 'notarytool',
appPath,
- keychainProfile: 'openwispr-profile',
+ ...(useApiKey ? {
+ // CI/CD with API key
+ teamId: process.env.APPLE_TEAM_ID,
+ appleApiKey: process.env.APPLE_API_KEY_PATH,
+ appleApiKeyId: process.env.APPLE_API_KEY_ID,
+ appleApiIssuer: process.env.APPLE_API_KEY_ISSUER_ID,
+ } : {
+ // Local with keychain profile
+ keychainProfile: 'openwispr-profile',
+ }),
staple: true
});
- console.log('✓ Notarization completed successfully');
- return result;
+
+ console.log('✓ Notarization successful');
} catch (error) {
console.error('Notarization failed:', error);
- throw error;
+ // Fail in CI, warn in local builds
+ if (process.env.CI) throw error;
+ console.warn('Continuing without notarization');
}
};
\ No newline at end of file
diff --git a/src/components/OnboardingFlow.tsx b/src/components/OnboardingFlow.tsx
index b74e67377..e386cd817 100644
--- a/src/components/OnboardingFlow.tsx
+++ b/src/components/OnboardingFlow.tsx
@@ -35,7 +35,7 @@ import { useClipboard } from "../hooks/useClipboard";
import { useSettings } from "../hooks/useSettings";
import { getLanguageLabel, getReasoningModelLabel } from "../utils/languages";
import LanguageSelector from "./ui/LanguageSelector";
-import InteractiveKeyboard from "./ui/Keyboard";
+const InteractiveKeyboard = React.lazy(() => import("./ui/Keyboard"));
import { setAgentName as saveAgentName } from "../utils/agentName";
interface OnboardingFlowProps {
@@ -505,7 +505,9 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
<h4 className="font-medium text-gray-900 mb-3">
Click any key to select it:
</h4>
- <InteractiveKeyboard selectedKey={hotkey} setSelectedKey={setHotkey} />
+ <React.Suspense fallback={<div>Loading keyboard...</div>}>
+ <InteractiveKeyboard selectedKey={hotkey} setSelectedKey={setHotkey} />
+ </React.Suspense>
</div>
</div>
</div>