Skip to content

v0.1.1: fix text classification false positives, add Windows/Linux CI… #25

v0.1.1: fix text classification false positives, add Windows/Linux CI…

v0.1.1: fix text classification false positives, add Windows/Linux CI… #25

Workflow file for this run

name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: aarch64-apple-darwin
bundle: dmg
suffix: ""
- os: macos-latest
target: x86_64-apple-darwin
bundle: dmg
suffix: "-intel"
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
bundle: deb
suffix: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
bundle: nsis
suffix: ".exe"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm install
- name: Install Linux deps
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev librsvg2-dev \
patchelf libssl-dev libgtk-3-dev libayatana-appindicator3-dev
- name: Install NSIS (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: choco install nsis -y --no-progress
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
src-tauri/target/release/build
src-tauri/target/release/.fingerprint
src-tauri/target/release/deps
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('src-tauri/Cargo.lock') }}
- name: Build
shell: bash
run: npm run tauri build -- --bundles ${{ matrix.bundle }}
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: BuffBrain-${{ matrix.target }}${{ matrix.suffix }}
path: |
src-tauri/target/release/bundle/${{ matrix.bundle }}/
src-tauri/target/release/buffbrain${{ matrix.suffix }}
release:
if: github.event_name == 'release'
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: BuffBrain-*
merge-multiple: true
- name: Upload release assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for file in *; do
if [ -f "$file" ]; then
gh release upload ${{ github.event.release.tag_name }} "$file"
fi
done