|
| 1 | +name: Check & Build |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - ".github/workflows/ci.yml" |
| 7 | + - "package.json" |
| 8 | + - "pnpm-lock.yaml" |
| 9 | + - "tsconfig.json" |
| 10 | + - "vite.config.*" |
| 11 | + - "src/**" |
| 12 | + - "src-tauri/**" |
| 13 | + push: |
| 14 | + branches: |
| 15 | + - next |
| 16 | + paths: |
| 17 | + - ".github/workflows/ci.yml" |
| 18 | + - "package.json" |
| 19 | + - "pnpm-lock.yaml" |
| 20 | + - "tsconfig.json" |
| 21 | + - "vite.config.*" |
| 22 | + - "src/**" |
| 23 | + - "src-tauri/**" |
| 24 | + |
| 25 | +permissions: |
| 26 | + contents: read |
| 27 | + |
| 28 | +jobs: |
| 29 | + build: |
| 30 | + name: Build (${{ matrix.name }}) |
| 31 | + runs-on: ${{ matrix.os }} |
| 32 | + |
| 33 | + strategy: |
| 34 | + fail-fast: false |
| 35 | + matrix: |
| 36 | + include: |
| 37 | + - name: linux |
| 38 | + os: ubuntu-latest |
| 39 | + artifact-name: FluAutoClicker-linux |
| 40 | + binary-path: src-tauri/target/release/fluautoclicker |
| 41 | + build-args: --bundles appimage,deb,rpm |
| 42 | + - name: windows |
| 43 | + os: windows-latest |
| 44 | + artifact-name: FluAutoClicker-windows |
| 45 | + binary-path: src-tauri/target/release/fluautoclicker.exe |
| 46 | + build-args: --no-bundle |
| 47 | + |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + |
| 51 | + - name: Install Linux dependencies |
| 52 | + if: runner.os == 'Linux' |
| 53 | + run: | |
| 54 | + sudo apt-get update |
| 55 | + sudo apt-get install -y \ |
| 56 | + build-essential \ |
| 57 | + curl \ |
| 58 | + file \ |
| 59 | + libappindicator3-dev \ |
| 60 | + libevdev-dev \ |
| 61 | + libgtk-3-dev \ |
| 62 | + libssl-dev \ |
| 63 | + libwebkit2gtk-4.1-dev \ |
| 64 | + libx11-dev \ |
| 65 | + libxdo-dev \ |
| 66 | + libxi-dev \ |
| 67 | + libxtst-dev \ |
| 68 | + librsvg2-dev \ |
| 69 | + patchelf \ |
| 70 | + rpm \ |
| 71 | + wget |
| 72 | +
|
| 73 | + - uses: pnpm/action-setup@v4 |
| 74 | + with: |
| 75 | + version: 9 |
| 76 | + |
| 77 | + - uses: actions/setup-node@v4 |
| 78 | + with: |
| 79 | + node-version: 20 |
| 80 | + cache: pnpm |
| 81 | + cache-dependency-path: pnpm-lock.yaml |
| 82 | + |
| 83 | + - uses: dtolnay/rust-toolchain@stable |
| 84 | + |
| 85 | + - name: Install dependencies |
| 86 | + run: pnpm install --frozen-lockfile |
| 87 | + |
| 88 | + - name: Typecheck |
| 89 | + run: pnpm run typecheck |
| 90 | + |
| 91 | + - name: Static smoke check |
| 92 | + run: pnpm run smoke:static |
| 93 | + |
| 94 | + - name: Rust format check |
| 95 | + run: cargo fmt --manifest-path src-tauri/Cargo.toml --check |
| 96 | + |
| 97 | + - name: Rust tests |
| 98 | + run: cargo test --manifest-path src-tauri/Cargo.toml |
| 99 | + |
| 100 | + - name: Build frontend |
| 101 | + run: pnpm run build |
| 102 | + |
| 103 | + - name: Build Tauri app |
| 104 | + run: pnpm tauri build ${{ matrix.build-args }} |
| 105 | + |
| 106 | + - name: Upload app artifacts |
| 107 | + uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: ${{ matrix.artifact-name }} |
| 110 | + if-no-files-found: error |
| 111 | + path: | |
| 112 | + ${{ matrix.binary-path }} |
| 113 | + src-tauri/target/release/bundle/** |
0 commit comments