Skip to content

Commit caac06b

Browse files
authored
Merge pull request #22 from joseiedo/ci/unified-build-workflow
ci: consolidate platform builds into a single matrix workflow
2 parents 4c7d25c + f2f341f commit caac06b

4 files changed

Lines changed: 91 additions & 166 deletions

File tree

.github/workflows/build-linux.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/build-mac.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/build-windows.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
include:
12+
- platform: windows-latest
13+
rust-targets: x86_64-pc-windows-msvc
14+
tauri-args: ""
15+
artifact-name: game-library-windows
16+
artifact-path: |
17+
src-tauri/target/release/bundle/msi/*.msi
18+
src-tauri/target/release/bundle/nsis/*.exe
19+
20+
- platform: ubuntu-latest
21+
rust-targets: x86_64-unknown-linux-gnu
22+
tauri-args: ""
23+
artifact-name: game-library-linux
24+
artifact-path: |
25+
src-tauri/target/release/bundle/deb/*.deb
26+
src-tauri/target/release/bundle/rpm/*.rpm
27+
src-tauri/target/release/bundle/appimage/*.AppImage
28+
29+
- platform: macos-latest
30+
rust-targets: aarch64-apple-darwin,x86_64-apple-darwin
31+
tauri-args: "--target universal-apple-darwin"
32+
artifact-name: game-library-mac
33+
artifact-path: |
34+
src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
35+
src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app
36+
37+
runs-on: ${{ matrix.platform }}
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: Install Linux dependencies
44+
if: matrix.platform == 'ubuntu-latest'
45+
run: |
46+
sudo apt update
47+
sudo apt install -y \
48+
libwebkit2gtk-4.1-dev \
49+
libgtk-3-dev \
50+
libayatana-appindicator3-dev \
51+
librsvg2-dev \
52+
patchelf \
53+
pkg-config \
54+
build-essential
55+
56+
- name: Set up Node.js
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: 20
60+
61+
- name: Enable Corepack and install Yarn
62+
run: |
63+
corepack enable
64+
yarn --version
65+
66+
- name: Install frontend dependencies
67+
run: yarn install --frozen-lockfile
68+
69+
- name: Set up Rust
70+
uses: dtolnay/rust-toolchain@stable
71+
with:
72+
targets: ${{ matrix.rust-targets }}
73+
74+
- name: Cache Rust dependencies
75+
uses: Swatinem/rust-cache@v2
76+
with:
77+
workspaces: src-tauri
78+
79+
- name: Build Tauri app
80+
run: yarn tauri build ${{ matrix.tauri-args }}
81+
env:
82+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
83+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
84+
85+
- name: Upload artifacts
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: ${{ matrix.artifact-name }}
89+
path: ${{ matrix.artifact-path }}
90+
if-no-files-found: error
91+
retention-days: 30

0 commit comments

Comments
 (0)