From f8284876839edabf64699482339f3e2fc9c65b66 Mon Sep 17 00:00:00 2001 From: Yury Rebrov Date: Thu, 29 Jan 2026 12:22:23 +0300 Subject: [PATCH] ci: add GitHub Actions workflows (ci, release) --- .github/workflows/ci.yml | 51 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 41 ++++++++++++++++++++++++++++ 2 files changed, 92 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..65e434d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + lint-typecheck: + name: Lint & TypeScript + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: desktop/ui/package-lock.json + + - name: Install UI deps + run: cd desktop/ui && npm ci + + - name: Lint + run: cd desktop/ui && npm run lint + + - name: TypeScript + run: cd desktop/ui && npx tsc --noEmit + + rust-check: + name: Rust check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-action@stable + + - name: Cache Cargo + uses: actions/cache@v4 + with: + path: | + desktop/src-tauri/target + ~/.cargo/registry + ~/.cargo/git + key: ${{ runner.os }}-cargo-${{ hashFiles('desktop/src-tauri/Cargo.lock') }} + + - name: Check + run: cd desktop/src-tauri && cargo check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f217b06 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +# Релиз: сборка .app / DMG, подпись (при наличии ключа), публикация в GitHub Releases и latest.json +# Настройка: в Secrets репозитория добавить TAURI_SIGNING_PRIVATE_KEY (приватный ключ от tauri signer generate) +name: Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + release: + name: Build & Release + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: desktop/ui/package-lock.json + + - name: Install Rust + uses: dtolnay/rust-action@stable + + - name: Install UI deps + run: cd desktop/ui && npm ci + + - name: Build Tauri (release) + uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} + with: + projectPath: desktop/src-tauri + includeUpdaterJson: true + tagName: ${{ github.ref_name }}