LCE-Emerald-Launcher/.github/workflows/publish.yml
2026-04-02 17:57:53 +03:00

146 lines
5.1 KiB
YAML

name: 'publish'
on:
workflow_dispatch:
jobs:
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- id: version
run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin'
- 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'
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: Create PKG with post-install script
if: matrix.platform == 'macos-latest'
run: |
# Create temporary directory for PKG creation
mkdir -p pkg_temp/scripts
cp scripts/postinstall.sh pkg_temp/scripts/
# Build the app first
pnpm tauri build -- ${{ matrix.args }}
# Find the built app
APP_PATH=$(find src-tauri/target/release/bundle/macos/ -name "*.app" | head -1)
APP_NAME=$(basename "$APP_PATH")
# Create PKG with post-install script
pkgbuild --root "$APP_PATH/.." \
--install-location /Applications \
--scripts pkg_temp/scripts \
--identifier "com.emerald.legacy" \
--version "1.0.0" \
--install-location "/Applications" \
--root "$APP_PATH" \
"Emerald-Legacy-Launcher.pkg"
# Move PKG to bundle directory
mkdir -p src-tauri/target/release/bundle/macos/
mv "Emerald-Legacy-Launcher.pkg" src-tauri/target/release/bundle/macos/
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__
releaseName: 'Emerald v__VERSION__'
releaseBody: |
# What to download?
- `Emerald.Legacy.Launcher-*.rpm` for GNU/Linux (RHEL)
- `Emerald.Legacy.Launcher-*.deb` for GNU/Linux (Debian+Ubuntu)
- `Emerald.Legacy.Launcher-*.AppImage` for GNU/Linux (Universal, Currently Broken)
- `Emerald.Legacy.Launcher-*_x64.dmg` for macOS (Intel)
- `Emerald.Legacy.Launcher-*_aarch64.dmg` for macOS (M-series)
- `Emerald.Legacy.Launcher-*.exe` for Windows (Setup)
- `Emerald.Legacy.Launcher-*.msi` for Windows (Setup)
- `Emerald.Legacy.Launcher.flatpak` for GNU/Linux (Flatpak, Recommended)
---
# Windows SmartScreen
This software is completely safe. Because the launcher is unsigned, you will see a "Windows protected your PC" window. To proceed:
1. Click the **"More info"** link under the main text.
2. Click the **"Run anyway"** button that appears.
---
# macOS "Damaged" Error Fix
The macOS builds now include automatic fixes for Gatekeeper quarantine issues. The app should launch without "application is damaged" errors.
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}
publish-flatpak:
needs: get-version
runs-on: ubuntu-latest
permissions:
contents: write
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 }}
- uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.get-version.outputs.version }}
files: Emerald.Legacy.Launcher.flatpak
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}