Workflow file for this run
This file contains 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: Amethyst Launcher Auto Build | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
get-version: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get app version | |
id: step | |
run: | | |
echo "text=$(jq -r .version src-tauri/tauri.conf.json)" >> "$GITHUB_OUTPUT" | |
outputs: | |
app_version: ${{ steps.step.outputs.text }} | |
build-arm-linux: | |
needs: [get-version] | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
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 | |
- arch: armv7l | |
cpu: cortex-a53 | |
deb: armhfp | |
rpm: arm | |
appimage: armhf | |
base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv7-Bookworm.img.xz | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache rust build artifacts | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: src-tauri | |
cache-on-failure: true | |
- 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 wget 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 yarn | |
npm install -g yarn | |
# Install frontend dependencies | |
yarn install | |
# Build the application | |
yarn tauri build -- --verbose | |
- name: Upload deb bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Debian Bundle | |
path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_${{ matrix.deb }}.deb | |
- name: Upload rpm bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: RPM Bundle | |
path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/amethyst-launcher-${{ needs.get-version.outputs.app_version }}-1.${{ matrix.rpm }}.rpm | |
- name: Upload appimage bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: AppImage Bundle | |
path: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_${{ matrix.appimage }}.AppImage | |
build-other: | |
needs: [get-version] | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: "macos-latest" # for Arm based macs (M1 and above). | |
args: "--target aarch64-apple-darwin" | |
arch: "aarch64" | |
target: "aarch64" | |
- platform: "macos-latest" # for Intel based macs. | |
args: "--target x86_64-apple-darwin" | |
arch: "x64" | |
target: "x86_64" | |
- platform: "ubuntu-22.04" | |
args: "" | |
- platform: "windows-latest" | |
args: "" | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install dependencies (ubuntu only) | |
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. | |
run: | | |
echo ${{ needs.get-version.outputs.app_version }} | |
sudo apt-get update | |
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf tree | |
- name: setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: "yarn" # Set this to npm, yarn or pnpm. | |
- name: install Rust stable | |
uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly | |
with: | |
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. | |
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
- name: Rust cache | |
uses: swatinem/rust-cache@v2 | |
with: | |
workspaces: "./src-tauri -> target" | |
cache-on-failure: true | |
# TODO: | |
- name: install tree | |
if: matrix.platform == 'macos-latest' | |
run: brew install tree | |
- name: install frontend dependencies | |
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too. | |
run: yarn install # change this to npm or pnpm depending on which one you use. | |
- name: Build the app | |
run: | | |
yarn tauri build -- ${{ matrix.args }} | |
- name: show files | |
run: | | |
tree ${{ github.workspace }}/src-tauri/target | |
# Upload the macos artifacts | |
- name: Upload deb bundle | |
uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'ubuntu-22.04' | |
with: | |
name: Debian Bundle | |
path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_amd64.deb | |
- name: Upload rpm bundle | |
uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'ubuntu-22.04' | |
with: | |
name: RPM Bundle | |
path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/amethyst-launcher-${{ needs.get-version.outputs.app_version }}-1.x86_64.rpm | |
- name: Upload appimage bundle | |
uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'ubuntu-22.04' | |
with: | |
name: AppImage Bundle | |
path: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_amd64.AppImage | |
- name: Upload msi bundle | |
uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'windows-latest' | |
with: | |
name: Windows Bundle(msi) | |
path: ${{ github.workspace }}/src-tauri/target/release/bundle/msi/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_x64_en-US.msi | |
- name: Upload exe bundle | |
uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'windows-latest' | |
with: | |
name: Windows Bundle(exe) | |
path: ${{ github.workspace }}/src-tauri/target/release/bundle/nsis/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_x64-setup.exe | |
- name: Upload dmg bundle | |
uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'macos-latest' | |
with: | |
name: MacOS ${{ matrix.arch }} bundle(dmg) | |
path: ${{ github.workspace }}/src-tauri/target/${{matrix.target}}-apple-darwin/release/bundle/dmg/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_${{ matrix.arch }}.dmg |