-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (101 loc) · 3.53 KB
/
ci.yml
File metadata and controls
119 lines (101 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: CI
on:
pull_request:
push:
branches: [master]
env:
CARGO_TERM_COLOR: always
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: x86_64-unknown-linux-gnu
artifact_name: byte-me-linux-x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: byte-me-windows-x86_64
artifact_extension: .exe
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: byte-me-macos-aarch64
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: byte-me-macos-x86_64
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
targets: ${{ matrix.target }}
- name: Use sccache
if: runner.os != 'Linux' && github.event_name != 'release' && github.event_name != 'workflow_dispatch'
uses: mozilla-actions/sccache-action@v0.0.9
- name: Configure sccache
if: runner.os != 'Linux' && github.event_name != 'release' && github.event_name != 'workflow_dispatch'
run: |
# Enable GitHub Actions for cache storage
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
# Use sccache for rustc
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
version: 10.26.2
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24.12.0
cache: "pnpm"
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Install backend dependencies
run: cargo fetch --manifest-path src-tauri/Cargo.toml
- name: Install Tauri CLI
uses: Xevion/cache-cargo-install-action@main
with:
tool: tauri-cli@2
locked: true
- name: Cache apt packages
if: runner.os == 'Linux'
uses: actions/cache@v5
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
# Update package list and install dependencies in one command to reduce time
sudo apt-get update -qq && 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 \
musl-tools
- name: Generate frontend bindings
run: pnpm run generate-types
- name: Build app (tauri)
run: cargo tauri build --target ${{ matrix.target }}
- name: Upload binary artifact
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.artifact_name }}
path: |
src-tauri/target/${{ matrix.target }}/release/byte-me${{ matrix.artifact_extension }}
src-tauri/target/${{ matrix.target }}/release/bundle/**/*
if-no-files-found: error