|
1 | | -name: "build" |
| 1 | +name: build |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [main] |
6 | | - pull_request: |
7 | | - branches: [main] |
| 5 | + branches: |
| 6 | + - electron |
| 7 | + paths: |
| 8 | + - "**.ts" |
| 9 | + - "**.js" |
| 10 | + - "**.mjs" |
| 11 | + - "**.json" |
| 12 | + - "**.svelte" |
| 13 | + - ".github/workflows/build.yaml" |
| 14 | + workflow_dispatch: |
8 | 15 |
|
9 | 16 | jobs: |
10 | | - build: |
11 | | - runs-on: ubuntu-latest |
| 17 | + release: |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 22 | + |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + |
12 | 25 | steps: |
13 | 26 | - uses: actions/checkout@v4 |
14 | 27 |
|
15 | | - - name: Install Ubuntu dependencies |
16 | | - run: | |
17 | | - sudo apt-get update |
18 | | - sudo apt-get install -y libwebkit2gtk-4.1-dev libasound2-dev libappindicator3-dev librsvg2-dev patchelf nsis lld llvm ninja-build nasm |
19 | | -
|
20 | | - - name: Setup node |
| 28 | + - name: Install Node.js |
21 | 29 | uses: actions/setup-node@v4 |
22 | 30 | with: |
23 | | - cache: "npm" |
24 | | - node-version: lts/* |
| 31 | + node-version: 22 |
| 32 | + cache: npm |
| 33 | + cache-dependency-path: "**/package-lock.json" |
25 | 34 |
|
26 | | - - name: Install npm dependencies |
| 35 | + - name: Install dependencies |
27 | 36 | run: npm ci |
28 | 37 |
|
29 | | - - name: Run frontend lint |
30 | | - run: npm run lint && npm run check |
31 | | - |
32 | | - - name: Install Rust |
33 | | - uses: dtolnay/rust-toolchain@stable |
34 | | - with: |
35 | | - targets: x86_64-pc-windows-msvc |
36 | | - |
37 | | - - name: Cache cargo-xwin |
38 | | - uses: actions/cache@v4 |
39 | | - with: |
40 | | - path: ~/.xwin |
41 | | - key: xwin-${{ hashFiles('**/Cargo.lock') }} |
42 | | - restore-keys: | |
43 | | - xwin- |
44 | | -
|
45 | | - - uses: Swatinem/rust-cache@v2 |
46 | | - with: |
47 | | - workspaces: "./src-tauri -> target" |
48 | | - |
49 | | - - name: Install cargo-xwin |
50 | | - run: cargo install --locked cargo-xwin |
51 | | - |
52 | | - - name: Run clippy |
53 | | - working-directory: src-tauri |
54 | | - run: cargo clippy |
| 38 | + - name: Run lint and typecheck |
| 39 | + if: matrix.os == 'ubuntu-latest' |
| 40 | + run: npm run lint && npm run typecheck |
55 | 41 |
|
56 | 42 | - name: Build for Linux |
57 | | - run: npm run tauri build |
| 43 | + if: matrix.os == 'ubuntu-latest' |
| 44 | + run: npm run build:linux |
| 45 | + |
| 46 | + - name: Build for macOS |
| 47 | + if: matrix.os == 'macos-latest' |
| 48 | + run: npm run build:mac |
58 | 49 |
|
59 | 50 | - name: Build for Windows |
60 | | - run: npm run tauri build -- --runner cargo-xwin --target x86_64-pc-windows-msvc -- --xwin-cache-dir ~/.xwin |
| 51 | + if: matrix.os == 'windows-latest' |
| 52 | + run: npm run build:win |
61 | 53 |
|
62 | | - - name: Create bundles folder and move artifacts |
63 | | - run: | |
64 | | - mkdir -p bundles |
65 | | - mv src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe bundles |
66 | | - mv src-tauri/target/release/bundle/rpm/*.rpm bundles |
67 | | - mv src-tauri/target/release/bundle/deb/*.deb bundles |
| 54 | + - name: Upload Linux installer |
| 55 | + if: matrix.os == 'ubuntu-latest' |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: linux |
| 59 | + path: ./dist/rt-*-linux.deb |
| 60 | + compression-level: 0 |
| 61 | + |
| 62 | + - name: Upload macOS installer |
| 63 | + if: matrix.os == 'macos-latest' |
| 64 | + uses: actions/upload-artifact@v4 |
| 65 | + with: |
| 66 | + name: mac |
| 67 | + path: ./dist/rt-*-mac.dmg |
| 68 | + compression-level: 0 |
68 | 69 |
|
69 | | - - uses: actions/upload-artifact@v4 |
| 70 | + - name: Upload Windows installer |
| 71 | + if: matrix.os == 'windows-latest' |
| 72 | + uses: actions/upload-artifact@v4 |
70 | 73 | with: |
71 | | - name: bundles |
72 | | - path: bundles |
| 74 | + name: windows |
| 75 | + path: ./dist/rt-*-win.exe |
| 76 | + compression-level: 0 |
0 commit comments