Build for Linux ARM #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build for Linux ARM | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| arch: [aarch64, armv7l] | |
| include: | |
| - arch: aarch64 | |
| cpu: cortex-a72 | |
| base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv8-Bookworm.img.xz | |
| deb: arm64 | |
| rpm: aarch64 | |
| appimage: aarch64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.4 | |
| run_install: false | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| src-tauri/target/ | |
| key: ${{ runner.os }}-arm-${{ matrix.arch }}-${{ hashFiles('Cargo.lock') }} | |
| - name: Build app | |
| uses: pguyot/arm-runner-action@v2.6.5 | |
| with: | |
| base_image: ${{ matrix.base_image }} | |
| cpu: ${{ matrix.cpu }} | |
| bind_mount_repository: true | |
| image_additional_mb: 10240 | |
| optimize_image: no | |
| exit_on_fail: no | |
| commands: | | |
| # Prevent Rust from complaining about $HOME not matching eid home | |
| export HOME=/root | |
| # Workaround to CI worker being stuck on Updating crates.io index | |
| export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse | |
| # Install setup prerequisites | |
| apt-get update -y --allow-releaseinfo-change | |
| apt-get autoremove -y | |
| apt-get install -y --no-install-recommends --no-install-suggests curl libwebkit2gtk-4.1-dev build-essential libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf libfuse2 file | |
| curl https://sh.rustup.rs -sSf | sh -s -- -y | |
| . "$HOME/.cargo/env" | |
| curl -fsSL https://deb.nodesource.com/setup_lts.x | bash | |
| apt-get install -y nodejs | |
| # Install frontend dependencies | |
| pnpm install | |
| # Build the application | |
| pnpm run tauri build -- --verbose | |
| - name: Get app version | |
| run: echo "APP_VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV | |
| - name: Upload deb bundle | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Debian Bundle ARM | |
| path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/switch-shuttle_${{ env.APP_VERSION }}_${{ matrix.deb }}.deb | |
| - name: Upload rpm bundle | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: RPM Bundle ARM | |
| path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/switch-shuttle-${{ env.APP_VERSION }}-1.${{ matrix.rpm }}.rpm | |
| - name: Upload appimage bundle | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AppImage Bundle ARM | |
| path: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/switch-shuttle_${{ env.APP_VERSION }}_${{ matrix.appimage }}.AppImage |