From 34ced67fe1729ef45d4a6d2275f70ca949aae392 Mon Sep 17 00:00:00 2001 From: LyAhn Date: Fri, 12 Jun 2026 18:41:32 +0100 Subject: [PATCH] ci: add CI checks and tag-triggered release workflow Phase 2 of the 0.1.0 release prep, running on the GitHub mirror: - ci.yml: frontend type-check/build, rustfmt gate, clippy (CPU-only) on windows-latest with pnpm + rust caching - release.yml: v* tags build the NSIS installer via tauri-action and attach it to a draft GitHub Release with updater JSON; updater signing secrets referenced ahead of Phase 3 - both build --no-default-features: runners have no CUDA toolkit, and the shipped artifact must be the CPU/DirectML build --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 54 +++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e40a64f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + check: + # windows-latest to match the release target — the ML crates (ort, candle) + # and the NSIS bundle only ever ship from Windows. + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + with: + version: 11 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Install frontend dependencies + run: pnpm install --frozen-lockfile + + # tsc + vite build; also produces dist/ which tauri's build script expects + - name: Type-check and build frontend + run: pnpm build:vite + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + + - uses: Swatinem/rust-cache@v2 + with: + workspaces: src-tauri + + - name: Rustfmt + working-directory: src-tauri + run: cargo fmt --check + + # Default features only — candle-cuda must never be enabled in CI. + - name: Clippy + working-directory: src-tauri + run: cargo clippy --all-targets --locked diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1e8fde7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Release + +# Tag pushes mirrored from Gitea (git.jezz.wtf) trigger this on the GitHub +# mirror. Builds the NSIS installer and attaches it to a DRAFT GitHub Release — +# review and publish manually. +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + release: + permissions: + contents: write + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + with: + version: 11 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + + - uses: Swatinem/rust-cache@v2 + with: + workspaces: src-tauri + + - name: Install frontend dependencies + run: pnpm install --frozen-lockfile + + - name: Build and create draft release + uses: tauri-apps/tauri-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Updater artifact signing (Phase 3) — set these repo secrets once + # the updater keypair exists; empty values are ignored until then. + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} + with: + tagName: ${{ github.ref_name }} + releaseName: 'Phokus v__VERSION__' + releaseBody: 'See the assets below to download and install this version.' + releaseDraft: true + prerelease: false + uploadUpdaterJson: true + updaterJsonPreferNsis: true