feat(desktop): test-connection button for image providers + DX improvements #112
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: Packaging smoke | |
| # Isolated from CI so the slow (~13 min) electron-builder run can complete | |
| # even when main gets additional pushes: workflow-level | |
| # `cancel-in-progress: true` cancels the ENTIRE workflow run, not just one | |
| # job. Keeping smoke in `ci.yml` meant every subsequent merge to main | |
| # killed smoke mid-flight and silently dropped the signal. A separate | |
| # workflow with its own per-SHA concurrency group is the only way to keep | |
| # the fast-feedback `check` job cancellable while still letting smoke run | |
| # to completion on every packaging-touching commit. | |
| # | |
| # Triggered only by files that can break packaging. Everyone else pays | |
| # zero extra CI cost. | |
| on: | |
| push: | |
| branches: [main, dev/v0.2] | |
| paths: | |
| - 'apps/desktop/electron-builder.yml' | |
| - 'apps/desktop/package.json' | |
| - 'apps/desktop/resources/**' | |
| - 'apps/desktop/scripts/**' | |
| - '.github/workflows/packaging-smoke.yml' | |
| - '.github/workflows/release.yml' | |
| - '.github/workflows/release-macos-x64-native-check.yml' | |
| pull_request: | |
| branches: [main, dev/v0.2] | |
| paths: | |
| - 'apps/desktop/electron-builder.yml' | |
| - 'apps/desktop/package.json' | |
| - 'apps/desktop/resources/**' | |
| - 'apps/desktop/scripts/**' | |
| - '.github/workflows/packaging-smoke.yml' | |
| - '.github/workflows/release.yml' | |
| - '.github/workflows/release-macos-x64-native-check.yml' | |
| permissions: | |
| contents: read | |
| # Per-SHA group, no cancellation. Each commit gets an independent smoke | |
| # that always runs to completion (or fails loudly). Skipping the | |
| # cancel-in-progress saves us from the ci.yml bug where an unrelated | |
| # later push on main would kill an already-running smoke. | |
| concurrency: | |
| group: packaging-smoke-${{ github.sha }} | |
| cancel-in-progress: false | |
| jobs: | |
| smoke: | |
| name: Linux packaging smoke | |
| runs-on: ubuntu-latest | |
| # 30 min because electron-builder takes ~12 min just for the AppImage | |
| # (node-module walk is the bottleneck), plus ~2 min each for deb and | |
| # rpm, plus setup. The first attempt at 15 min hit the timeout mid-rpm | |
| # and got killed with no useful diagnostic. | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install | |
| run: env -u ELECTRON_SKIP_BINARY_DOWNLOAD -u ELECTRON_SKIP_DOWNLOAD pnpm install --frozen-lockfile --ignore-scripts=false | |
| - name: Install Electron binary | |
| run: | | |
| env -u ELECTRON_SKIP_BINARY_DOWNLOAD -u ELECTRON_SKIP_DOWNLOAD pnpm -C apps/desktop exec node -e " | |
| const { execFileSync } = require('node:child_process'); | |
| const path = require('node:path'); | |
| const electronDir = path.dirname(require.resolve('electron/package.json')); | |
| execFileSync(process.execPath, [path.join(electronDir, 'install.js')], { stdio: 'inherit' }); | |
| " | |
| - name: Verify Electron binary | |
| run: | | |
| env -u ELECTRON_SKIP_BINARY_DOWNLOAD -u ELECTRON_SKIP_DOWNLOAD pnpm -C apps/desktop exec node -e " | |
| const fs = require('node:fs'); | |
| const electronPath = require('electron'); | |
| fs.accessSync(electronPath, fs.constants.X_OK); | |
| console.log(electronPath); | |
| " | |
| # electron-builder's rpm target shells out to `rpmbuild`, which is not | |
| # present on ubuntu-latest by default. | |
| - name: Install rpmbuild | |
| run: sudo apt-get update && sudo apt-get install -y --no-install-recommends rpm | |
| - name: Build workspace | |
| run: pnpm --filter '!@open-codesign/desktop' -r build | |
| - name: Package Linux (AppImage + deb + rpm) | |
| env: | |
| CSC_IDENTITY_AUTO_DISCOVERY: 'false' | |
| run: pnpm --filter @open-codesign/desktop release | |
| - name: Assert artifacts | |
| run: | | |
| cd apps/desktop/release | |
| ls -la | |
| for ext in AppImage deb rpm; do | |
| if ! ls *."$ext" >/dev/null 2>&1; then | |
| echo "::error::no .$ext produced by electron-builder" | |
| exit 1 | |
| fi | |
| done | |
| echo "All three Linux artifacts present." |