Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Electron App | ||
|
Check failure on line 1 in .github/workflows/build-electron.yml
|
||
| on: | ||
| # Trigger on version tags (e.g., v0.1.0, v1.2.3) | ||
| push: | ||
| tags: | ||
| - 'v*.*.*' | ||
| jobs: | ||
| build: | ||
| name: Build Windows | ||
| runs-on: windows-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Required for electron-builder to generate proper version info | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '23' | ||
| cache: 'npm' | ||
| cache-dependency-path: | | ||
| app/package-lock.json | ||
| frontend/package-lock.json | ||
| - name: Install frontend dependencies | ||
| working-directory: ./frontend | ||
| run: npm ci | ||
| - name: Security audit - Frontend | ||
| working-directory: ./frontend | ||
| run: npm audit --audit-level=moderate | ||
| continue-on-error: true # Don't fail build on audit issues, but report them | ||
| - name: Build frontend | ||
| working-directory: ./frontend | ||
| run: npm run build | ||
| - name: Install app dependencies | ||
| working-directory: ./app | ||
| run: npm ci | ||
| - name: Security audit - Electron App | ||
| working-directory: ./app | ||
| run: npm audit --audit-level=moderate | ||
| continue-on-error: true # Don't fail build on audit issues, but report them | ||
| - name: Run tests | ||
| working-directory: ./app | ||
| run: npm test | ||
| - name: Build application | ||
| working-directory: ./app | ||
| run: npm run compile | ||
| - name: Build Electron app (Windows) | ||
| working-directory: ./app | ||
| run: npm run dist:win | ||
| - name: Sign files with Azure Trusted Signing | ||
| if: secrets.AZURE_CLIENT_ID != '' && secrets.AZURE_TENANT_ID != '' && secrets.AZURE_CLIENT_SECRET != '' && secrets.AZURE_ENDPOINT != '' && secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME != '' && secrets.AZURE_CERTIFICATE_PROFILE_NAME != '' | ||
| uses: azure/trusted-signing-action@v0 | ||
| with: | ||
| azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
| azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
| azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
| endpoint: ${{ secrets.AZURE_ENDPOINT }} | ||
| trusted-signing-account-name: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }} | ||
| certificate-profile-name: ${{ secrets.AZURE_CERTIFICATE_PROFILE_NAME }} | ||
| files-folder: ${{ github.workspace }}\app\dist | ||
| files-folder-filter: exe,dll | ||
| file-digest: SHA256 | ||
| timestamp-rfc3161: http://timestamp.acs.microsoft.com | ||
| timestamp-digest: SHA256 | ||
| - name: Publish Electron app (Windows) | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| working-directory: ./app | ||
| run: npx electron-builder --win --publish always | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: windows-artifacts | ||
| path: | | ||
| app/dist/**/* | ||
| retention-days: 30 | ||
| if-no-files-found: error | ||