-
-
Notifications
You must be signed in to change notification settings - Fork 14
83 lines (69 loc) · 2.12 KB
/
Copy pathbuild.yml
File metadata and controls
83 lines (69 loc) · 2.12 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
name: Main Workflow
on:
push:
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Repository Checkout
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache APT packages
uses: awalsh128/cache-apt-pkgs-action@v1.6.1
with:
packages: libgtk-3-dev libappindicator3-dev libxdo-dev
version: 1.0
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Set up Node and pnpm
uses: jdx/mise-action@v2
- name: Run Unit Tests
run: |
cargo check
cargo test
# Build artifacts for all platforms when 'build-artifacts' label is present
build-artifacts:
name: Build Artifacts
if: contains(github.event.pull_request.labels.*.name, 'build-artifacts')
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact: discrakt.exe
name: windows
- os: macos-14
target: aarch64-apple-darwin
artifact: discrakt
name: macos-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact: discrakt
name: linux-x64
runs-on: ${{ matrix.os }}
steps:
- name: Repository Checkout
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libappindicator3-dev libxdo-dev
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Set up Node and pnpm
uses: jdx/mise-action@v2
- name: Build
env:
DISCRAKT_VERSION: 0.0.0-test
run: cargo build --release
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: discrakt-${{ matrix.name }}
path: target/release/${{ matrix.artifact }}
retention-days: 14