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" 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-x86_64" - platform: "windows-latest" args: "" artifact-name: "windows-x86_64" 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.2.1" \ "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/**/* src-tauri/target/*/release/bundle/**/* 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 }} - name: upload flatpak artifact uses: actions/upload-artifact@v4 with: name: flatpak path: Emerald.Legacy.Launcher.flatpak publish-release: needs: [get-version, publish-tauri, publish-flatpak] runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/download-artifact@v4 with: pattern: "*" merge-multiple: true path: artifacts - uses: softprops/action-gh-release@v2 with: tag_name: v${{ needs.get-version.outputs.version }} name: "Emerald v${{ needs.get-version.outputs.version }}" body: | # 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. files: artifacts/* draft: true prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}