Files
2026-05-18 08:05:05 -05:00

213 lines
7.6 KiB
YAML

name: 'nightly'
on:
push:
branches: ["main"]
paths-ignore:
- 'README.md'
workflow_dispatch:
permissions:
contents: write
id-token: write
attestations: write
concurrency:
group: nightly
cancel-in-progress: true
jobs:
nightly-tauri:
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: Build and create DMG for macOS
if: matrix.platform == 'macos-latest'
run: |
APP_VERSION=$(node -p "require('./package.json').version")
pnpm build
cd src-tauri
cargo build --release --target ${{ matrix.args }}
cd ..
TARGET_ARCH=${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}
mkdir -p "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/MacOS"
mkdir -p "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/Resources"
cp "src-tauri/target/$TARGET_ARCH/release/revelations-launcher" "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/MacOS/"
printf '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n<dict>\n <key>CFBundleExecutable</key>\n <string>revelations-launcher</string>\n <key>CFBundleIdentifier</key>\n <string>com.revelations.lce</string>\n <key>CFBundleName</key>\n <string>Revelations Launcher</string>\n <key>CFBundleVersion</key>\n <string>'"$APP_VERSION"'</string>\n <key>CFBundleShortVersionString</key>\n <string>'"$APP_VERSION"'</string>\n <key>CFBundlePackageType</key>\n <string>APPL</string>\n <key>NSHighResolutionCapable</key>\n <true/>\n <key>LSApplicationCategoryType</key>\n <string>public.app-category.games</string>\n</dict>\n</plist>\n' > "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/Info.plist"
if [ -f "src-tauri/icons/icon.icns" ]; then
cp src-tauri/icons/icon.icns "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/Resources/"
fi
chmod +x "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/MacOS/revelations-launcher"
cd "src-tauri/target/$TARGET_ARCH/release/bundle/macos"
hdiutil create -volname "Revelations Launcher" -srcfolder "Revelations Launcher.app" -ov -format UDZO "Revelations Launcher.dmg"
mkdir -p "$GITHUB_WORKSPACE/src-tauri/target/release/bundle/dmg/"
mv "Revelations Launcher.dmg" "$GITHUB_WORKSPACE/src-tauri/target/release/bundle/dmg/"
- name: Build with tauri-action for Windows and Linux
if: matrix.platform != 'macos-latest'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NO_STRIP: ${{ matrix.platform == 'ubuntu-22.04' && 'true' || '' }}
with:
args: ${{ matrix.args }}
- name: Stage artifacts
shell: bash
run: |
mkdir -p staging
cp src-tauri/target/release/bundle/deb/*.deb staging/ 2>/dev/null || true
cp src-tauri/target/release/bundle/appimage/*.AppImage staging/ 2>/dev/null || true
cp src-tauri/target/release/bundle/rpm/*.rpm staging/ 2>/dev/null || true
cp src-tauri/target/release/bundle/msi/*.msi staging/ 2>/dev/null || true
cp src-tauri/target/release/bundle/dmg/*.dmg staging/ 2>/dev/null || true
ls -la staging/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.platform }}-${{ strategy.job-index }}
path: staging/*
release:
name: Create Release
needs: nightly-tauri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List artifacts
run: find artifacts -type f | head -30
- name: Attest build provenance
uses: actions/attest-build-provenance@v2
with:
subject-path: artifacts/*
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_tag_gpgsign: true
- name: Get short SHA
id: sha
run: echo "short=$(echo '${{ github.sha }}' | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: Delete old release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release delete nightly --yes || true
- name: Delete old tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh api repos/${{ github.repository }}/git/refs/tags/nightly --method DELETE || true
- name: Create signed tag
run: |
git tag -s -f nightly -m "Nightly release ${{ steps.sha.outputs.short }}"
git push origin nightly --force
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create nightly artifacts/* \
--title "Revelations Launcher: ${{ steps.sha.outputs.short }}" \
--notes "## What to download?
### Linux
- **RHEL/Fedora**: \`.rpm\`
- **Debian/Ubuntu**: \`.deb\`
- **Universal**: \`.AppImage\`
### macOS
- **Intel Mac**: \`x64.dmg\`
- **M-series Mac**: \`aarch64.dmg\`
### Windows
- **MSI Installer**: \`.msi\`
---
## 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 **\"More info\"** under the main text.
2. Click **\"Run anyway\"**.
## macOS Installation
Download the DMG, open it, and drag the app to Applications.
If you see \"app damaged\" error: \`xattr -cr \"/Applications/Revelations Launcher.app\"\`" \
--latest
cleanup:
needs: release
if: always()
runs-on: ubuntu-latest
steps:
- name: Cleanup artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: build-*