diff --git a/.github/workflows/experimental.yml b/.github/workflows/experimental.yml index 74b9acd..fc4e151 100644 --- a/.github/workflows/experimental.yml +++ b/.github/workflows/experimental.yml @@ -108,3 +108,58 @@ jobs: with: name: flatpak path: Emerald.Legacy.Launcher.flatpak + + publish-experimental: + needs: [build-tauri, build-flatpak] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: main + + - name: Download all build artifacts + uses: actions/download-artifact@v4 + + - name: Prepare assets and update release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p dist + # Find and copy all dmg, AppImage, and flatpak files from downloaded artifacts + find . -name "*.dmg" -exec cp {} dist/ \; + find . -name "*.AppImage" -exec cp {} dist/ \; + find . -name "*.flatpak" -exec cp {} dist/ \; + ls -la dist + + # Delete existing experimental release and tag to recreate it + gh release delete experimental --yes --cleanup-tag || true + git push origin :refs/tags/experimental || true + + # Create new experimental pre-release + gh release create experimental dist/* \ + --title "Experimental Build" \ + --notes "Automated experimental build from commit ${GITHUB_SHA::8}." \ + --prerelease + + # Extract version from package.json + BASE_VERSION=$(jq -r .version package.json) + SHORT_SHA="${GITHUB_SHA::7}" + VERSION="${BASE_VERSION}-experimental-${SHORT_SHA}" + echo "Experimental Version: $VERSION" + + # Compute hashes for Mac casks + INTEL_HASH=$(sha256sum dist/LCE.Emerald.Launcher_${BASE_VERSION}_x64.dmg | cut -d' ' -f1) + ARM_HASH=$(sha256sum dist/LCE.Emerald.Launcher_${BASE_VERSION}_aarch64.dmg | cut -d' ' -f1) + + python3 scripts/update-homebrew.py --type experimental --version "$VERSION" --intel-hash "$INTEL_HASH" --arm-hash "$ARM_HASH" + + - name: Commit and push changes + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add Casks/ + git diff --quiet && git diff --staged --quiet || (git commit -m "chore: update experimental Homebrew cask [skip ci]" && git push origin main) + diff --git a/.github/workflows/update-homebrew-stable.yml b/.github/workflows/update-homebrew-stable.yml new file mode 100644 index 0000000..5d9cf72 --- /dev/null +++ b/.github/workflows/update-homebrew-stable.yml @@ -0,0 +1,47 @@ +name: Update Homebrew Cask (Stable) + +on: + release: + types: [published] + +jobs: + update-cask: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: main + + - name: Download release assets and update homebrew files + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG="${{ github.event.release.tag_name }}" + VERSION="${TAG#v}" + echo "Processing tag $TAG (version: $VERSION)" + + mkdir -p dist + # Download the Intel dmg, Apple Silicon dmg, and Linux AppImage + gh release download "$TAG" --dir dist --pattern "*_x64.dmg" --pattern "*_aarch64.dmg" --pattern "*_amd64.AppImage" -R "${{ github.repository }}" + ls -l dist + + # Calculate hashes + INTEL_HASH=$(sha256sum dist/*_x64.dmg | cut -d' ' -f1) + ARM_HASH=$(sha256sum dist/*_aarch64.dmg | cut -d' ' -f1) + LINUX_HASH=$(sha256sum dist/*_amd64.AppImage | cut -d' ' -f1) + + echo "Intel SHA: $INTEL_HASH" + echo "ARM SHA: $ARM_HASH" + echo "Linux SHA: $LINUX_HASH" + + python3 scripts/update-homebrew.py --type stable --version "$VERSION" --intel-hash "$INTEL_HASH" --arm-hash "$ARM_HASH" --linux-hash "$LINUX_HASH" + + - name: Commit and push changes + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add Casks/ Formula/ + git diff --quiet && git diff --staged --quiet || (git commit -m "chore: update stable Homebrew casks/formula [skip ci]" && git push origin main) diff --git a/README.md b/README.md index 31ca458..0513b86 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ LCE Emerald Launcher is the easiest way to play Minecraft Legacy Console Edition |--------|-------------| | `.dmg` (x64) | Intel Macs | | `.dmg` (aarch64) | Apple Silicon (M-series and A-series) | +| Homebrew Cask | Intel & Apple Silicon (via tap) | **Installation Steps:** 1. Download the appropriate DMG for your Mac @@ -98,6 +99,18 @@ LCE Emerald Launcher is the easiest way to play Minecraft Legacy Console Edition - Right-click the app → **Open** → confirm **Open** - Or run: `xattr -cr "/Applications/Emerald Legacy Launcher.app"` +**Homebrew:** +```bash +# Tap the repository +brew tap LCE-Hub/lce-emerald-launcher-cask https://github.com/LCE-Hub/LCE-Emerald-Launcher-cask + +# Install stable release +brew install --cask lce-emerald-launcher + +# Or install experimental release +brew install --cask lce-emerald-launcher-experimental +``` + ### GNU/Linux Multiple distribution formats available: @@ -109,6 +122,7 @@ Multiple distribution formats available: | `.AppImage` | Universal (no installation required) | | `.flatpak` | Universal with sandboxing (recommended over AppImage) | | Nix flake | NixOS and any Linux with [Nix](https://nixos.org/download/) installed | +| Homebrew | Any Linux with [Homebrew](https://brew.sh/) installed | **AUR:** Special thanks to [AntiApple4life](https://aur.archlinux.org/packages?O=0&SeB=m&K=AntiApple4life) for the AUR packages! @@ -152,6 +166,15 @@ sudo emerge games-util/emerald-legacy-launcher # 1.5.1 flatpak install emerald.flatpak ``` +**Homebrew:** +```bash +# Tap the repository +brew tap LCE-Hub/lce-emerald-launcher-cask https://github.com/LCE-Hub/LCE-Emerald-Launcher-cask + +# Install stable release +brew install lce-emerald-launcher +``` + **Dependencies (if building from source):** ```bash # Ubuntu/Debian