Build for Linux ARM #7
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: | |
| target: [aarch64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf] | |
| include: | |
| - target: aarch64-unknown-linux-gnu | |
| deb: arm64 | |
| rpm: aarch64 | |
| appimage: aarch64 | |
| linker: aarch64-linux-gnu-gcc | |
| - target: armv7-unknown-linux-gnueabihf | |
| deb: armhf | |
| rpm: armv7hl | |
| appimage: armv7l | |
| linker: arm-linux-gnueabihf-gcc | |
| 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' | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf | |
| - 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.target }}-${{ hashFiles('Cargo.lock') }} | |
| - name: Install frontend dependencies | |
| run: pnpm install | |
| - name: Build Tauri app | |
| run: | | |
| export CARGO_TARGET_$(echo ${{ matrix.target }} | tr '-' '_')_LINKER=${{ matrix.linker }} | |
| pnpm run tauri build -- --target ${{ matrix.target }} | |
| - 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 ${{ matrix.target }} | |
| path: ${{ github.workspace }}/src-tauri/target/${{ matrix.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 ${{ matrix.target }} | |
| path: ${{ github.workspace }}/src-tauri/target/${{ matrix.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 ${{ matrix.target }} | |
| path: ${{ github.workspace }}/src-tauri/target/${{ matrix.target }}/release/bundle/appimage/switch-shuttle_${{ env.APP_VERSION }}_${{ matrix.appimage }}.AppImage |