LCE-Emerald-Launcher/.github/workflows/experimental.yml
/home/neo d536a6590b
Some checks failed
Nix / build (push) Has been cancelled
feat: xbox360+ps3+java->windows64 world conversion (#145)
Co-authored-by: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com>
2026-08-07 19:01:24 +03:00

170 lines
5.2 KiB
YAML

name: "experimental"
on:
workflow_dispatch:
jobs:
build-tauri:
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest"
args: "--target aarch64-apple-darwin"
artifact-name: macos-aarch64
- platform: "macos-latest"
args: "--target x86_64-apple-darwin"
artifact-name: macos-x86_64
- platform: "ubuntu-22.04"
args: ""
artifact-name: linux
- platform: "windows-latest"
args: ""
artifact-name: windows
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libudev-dev
- name: setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "pnpm"
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
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"
- name: install frontend dependencies
run: pnpm install
- name: build Tauri app
run: pnpm run tauri:build -- ${{ matrix.args }}
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Create PKG with post-install script (macOS only)
if: matrix.platform == 'macos-latest'
run: |
mkdir -p pkg_temp/scripts
cp scripts/postinstall.sh pkg_temp/scripts/
MACOS_BUNDLE_DIR=$(find src-tauri/target -path "*/release/bundle/macos" -type d | head -n 1)
APP_PATH=$(find "$MACOS_BUNDLE_DIR" -name "*.app" -type d | head -n 1)
if [ -z "$APP_PATH" ]; then
echo "No .app found in $MACOS_BUNDLE_DIR"
exit 1
fi
APP_NAME=$(basename "$APP_PATH")
pkgbuild --root "$APP_PATH/.." \
--install-location /Applications \
--scripts pkg_temp/scripts \
--identifier "com.emerald.legacy" \
--version "1.0.0" \
"Emerald-Legacy-Launcher.pkg"
mv "Emerald-Legacy-Launcher.pkg" "$MACOS_BUNDLE_DIR/"
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: |
src-tauri/target/**/release/bundle/**/*
build-flatpak:
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08
options: --privileged
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: sleep for 10 seconds
run: sleep 10
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: Emerald.Legacy.Launcher.flatpak
manifest-path: flatpak/io.github.Emerald_Legacy_Launcher.Emerald_Legacy_Launcher.yml
cache-key: flatpak-builder-${{ github.sha }}
- name: upload flatpak artifact
uses: actions/upload-artifact@v4
with:
name: flatpak
path: Emerald.Legacy.Launcher.flatpak
build-appimage:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: Bootstrap keyring and git
run: |
pacman -Syu --noconfirm archlinux-keyring
pacman -S --noconfirm --needed git
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v4
with:
path: |
src-tauri/target
node_modules
/var/cache/pacman/pkg
key: arch-${{ hashFiles('src-tauri/Cargo.lock', 'pnpm-lock.yaml') }}
restore-keys: arch-
- name: Install build dependencies
run: |
pacman -S --noconfirm --needed \
base-devel wget zsync nodejs patchelf \
cargo cargo-tauri \
gtk3 libayatana-appindicator webkit2gtk-4.1 glib-networking librsvg \
xorg-server-xvfb
- name: setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Build deb with tauri
run: |
pnpm install
cargo-tauri build --bundles deb --config '{"bundle":{"createUpdaterArtifacts":false},"build":{"beforeBuildCommand":"pnpm build"}}'
- name: Extract deb into /usr
run: |
cd src-tauri/target/release/bundle/deb
ar x ./*.deb
tar -xf data.tar.*
cp -a usr/. /usr/
- name: Build AppImage
run: |
cd pkg/AppImage
chmod +x ./AppImage.sh
./AppImage.sh
- uses: actions/upload-artifact@v4
with:
name: appimage
path: pkg/AppImage/dist/*.AppImage