mirror of
https://github.com/Xevion/byte-me.git
synced 2025-12-06 05:14:37 -06:00
117 lines
3.3 KiB
YAML
117 lines
3.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [master]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTC_WRAPPER: sccache
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
SCCACHE_CACHE_SIZE: "2G"
|
|
|
|
jobs:
|
|
build:
|
|
name: Build (${{ matrix.os }}${{ matrix.target && format(' / {0}', matrix.target) || '' }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-22.04
|
|
target: ""
|
|
artifact_name: byte-me-linux-x86_64
|
|
artifact_path: src-tauri/target/x86_64-unknown-linux-gnu/release/byte-me
|
|
- os: windows-latest
|
|
target: ""
|
|
artifact_name: byte-me-windows-x86_64
|
|
artifact_path: src-tauri/target/x86_64-pc-windows-msvc/release/byte-me.exe
|
|
- os: macos-latest
|
|
target: aarch64-apple-darwin
|
|
artifact_name: byte-me-macos-aarch64
|
|
artifact_path: src-tauri/target/aarch64-apple-darwin/release/byte-me
|
|
- os: macos-latest
|
|
target: x86_64-apple-darwin
|
|
artifact_name: byte-me-macos-x86_64
|
|
artifact_path: src-tauri/target/x86_64-apple-darwin/release/byte-me
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Install sccache
|
|
uses: taiki-e/install-action@sccache
|
|
|
|
- name: Configure sccache
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
core.exportVariable("ACTIONS_RESULTS_URL", process.env.ACTIONS_RESULTS_URL || "");
|
|
core.exportVariable("ACTIONS_RUNTIME_TOKEN", process.env.ACTIONS_RUNTIME_TOKEN || "");
|
|
|
|
- name: Rust cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: src-tauri
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: "pnpm"
|
|
|
|
- name: Install JS deps
|
|
run: pnpm install --frozen-lockfile --prefer-offline
|
|
|
|
- name: Install Rust dependencies
|
|
run: cargo fetch --manifest-path src-tauri/Cargo.toml
|
|
|
|
- name: Install Tauri CLI
|
|
uses: taiki-e/cache-cargo-install-action@v2
|
|
with:
|
|
tool: tauri-cli@2
|
|
locked: true
|
|
|
|
- name: Install Linux dependencies
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
libxdo-dev \
|
|
libglib2.0-dev \
|
|
libwebkit2gtk-4.1-dev \
|
|
libayatana-appindicator3-dev \
|
|
librsvg2-dev \
|
|
patchelf
|
|
|
|
- name: Build app (tauri - host)
|
|
if: matrix.target == ''
|
|
run: cargo tauri build
|
|
|
|
- name: Build app (tauri - target)
|
|
if: matrix.target != ''
|
|
run: cargo tauri build --target ${{ matrix.target }}
|
|
|
|
- name: Upload binary artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact_name }}
|
|
path: ${{ matrix.artifact_path }}
|
|
|
|
- name: sccache stats
|
|
if: always()
|
|
run: sccache --show-stats
|