From c6bab68ed9780ed0e79caefa0c2e7c9fe39a2c58 Mon Sep 17 00:00:00 2001 From: Alex Zappa Date: Tue, 11 Aug 2026 03:14:11 +0200 Subject: [PATCH] ci: add CI and release workflows - ci.yml: cargo check + npm build on push/PR - release.yml: auto-publish to crates.io and npm on GitHub release published Requires CARGO_REGISTRY_TOKEN and NPM_TOKEN secrets in repo settings --- .github/workflows/ci.yml | 31 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 67 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..7925998 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + check: + name: Build & Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - name: Install system dependencies + run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libglib2.0-dev + + - uses: dtolnay/rust-toolchain@stable + + - uses: actions/setup-node@v7 + with: + node-version: 20 + + - name: Install JS deps + run: npm install + + - name: Build JS + run: npm run build + + - name: Check Rust + run: cargo check \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4733630 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + release: + types: [published] + +jobs: + publish-crates: + name: Publish to crates.io + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: dtolnay/rust-toolchain@stable + + - name: Publish + run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + publish-npm: + name: Publish to npm + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-node@v7 + with: + node-version: 20 + registry-url: https://registry.npmjs.org + + - run: npm install + + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file