- Brand is now SCOPENET everywhere (defaults, UI, installer, docs) - Launcher: solid backgrounds (no animated orbs/grain), flat Play button without gradient/shine/glow, quieter rail with a simple active indicator, smaller type scale, Inter as default font, glass off by default, restyled sliders - Panel: same flat treatment; live preview mirrors the new launcher - New flat scope-reticle logo and app icons - Calmer default palette - Fix: lock the shared cargo cache in the Docker build (amd64/arm64 raced) - Fix: Windows-only clippy lint in sys.rs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ARcGWxLx21FwXJ3yfGriS
166 lines
5.8 KiB
YAML
166 lines
5.8 KiB
YAML
name: Release
|
|
|
|
# Publish a release by pushing a tag (`git tag v0.2.0 && git push origin v0.2.0`)
|
|
# or from the Actions tab → Release → Run workflow (enter a version).
|
|
#
|
|
# Optional repository variables (Settings → Secrets and variables → Actions → Variables):
|
|
# PANEL_URL https://panel.example.com — baked into the launcher as the default server
|
|
# LOCK_PANEL "1" to stop players from changing the server
|
|
# LAUNCHER_NAME Installer / window name (default "SCOPENET Launcher")
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*.*.*']
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version to release (e.g. 0.2.0)'
|
|
required: true
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
version:
|
|
runs-on: ubuntu-24.04
|
|
outputs:
|
|
version: ${{ steps.v.outputs.version }}
|
|
tag: ${{ steps.v.outputs.tag }}
|
|
steps:
|
|
- id: v
|
|
shell: bash
|
|
run: |
|
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then v="${{ inputs.version }}"; else v="${GITHUB_REF_NAME}"; fi
|
|
v="${v#v}"
|
|
if ! [[ "$v" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$ ]]; then echo "::error::'$v' is not a semantic version"; exit 1; fi
|
|
echo "version=$v" >> "$GITHUB_OUTPUT"
|
|
echo "tag=v$v" >> "$GITHUB_OUTPUT"
|
|
|
|
launcher:
|
|
name: Windows installer
|
|
needs: version
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: release
|
|
- uses: actions/setup-node@v5
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
cache-dependency-path: launcher/package-lock.json
|
|
|
|
- name: Stamp version
|
|
shell: bash
|
|
env:
|
|
VERSION: ${{ needs.version.outputs.version }}
|
|
run: |
|
|
sed -i "0,/^version = \".*\"/s//version = \"$VERSION\"/" Cargo.toml
|
|
node -e "const f='launcher/src-tauri/tauri.conf.json';const c=require('./'+f);c.version=process.env.VERSION;require('fs').writeFileSync(f,JSON.stringify(c,null,2))"
|
|
node -e "const f='launcher/package.json';const c=require('./'+f);c.version=process.env.VERSION;require('fs').writeFileSync(f,JSON.stringify(c,null,2))"
|
|
|
|
- run: npm ci --no-audit --no-fund
|
|
working-directory: launcher
|
|
|
|
- name: Build installer
|
|
working-directory: launcher
|
|
shell: bash
|
|
env:
|
|
SCOPENET_PANEL_URL: ${{ vars.PANEL_URL }}
|
|
SCOPENET_LOCK_PANEL: ${{ vars.LOCK_PANEL }}
|
|
SCOPENET_REPO: ${{ github.repository }}
|
|
LAUNCHER_NAME: ${{ vars.LAUNCHER_NAME }}
|
|
run: |
|
|
if [ -n "$LAUNCHER_NAME" ]; then
|
|
CONFIG=$(node -e "console.log(JSON.stringify({productName: process.env.LAUNCHER_NAME, app: {windows: [{...require('./src-tauri/tauri.conf.json').app.windows[0], title: process.env.LAUNCHER_NAME}]}}))")
|
|
npx tauri build --bundles nsis --config "$CONFIG"
|
|
else
|
|
npx tauri build --bundles nsis
|
|
fi
|
|
|
|
- name: Collect installer
|
|
shell: bash
|
|
run: |
|
|
mkdir -p out
|
|
cp target/release/bundle/nsis/*-setup.exe out/
|
|
ls -la out
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows-installer
|
|
path: out/*-setup.exe
|
|
if-no-files-found: error
|
|
|
|
panel-image:
|
|
name: Panel image (GHCR)
|
|
needs: version
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Image name (GHCR needs lowercase)
|
|
run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/scopenet-mc-panel" >> "$GITHUB_ENV"
|
|
- name: Stamp version
|
|
run: sed -i "0,/^version = \".*\"/s//version = \"${{ needs.version.outputs.version }}\"/" Cargo.toml
|
|
- uses: docker/setup-buildx-action@v3
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ env.IMAGE }}
|
|
tags: |
|
|
type=semver,pattern={{version}},value=${{ needs.version.outputs.tag }}
|
|
type=semver,pattern={{major}}.{{minor}},value=${{ needs.version.outputs.tag }}
|
|
type=raw,value=latest,enable=${{ !contains(needs.version.outputs.version, '-') }}
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
release:
|
|
name: GitHub release
|
|
needs: [version, launcher, panel-image]
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: windows-installer
|
|
path: dist
|
|
- name: Release notes
|
|
run: |
|
|
IMAGE="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/scopenet-mc-panel"
|
|
cat > notes.md <<NOTES
|
|
## Downloads
|
|
|
|
**Launcher (Windows):** download the \`-setup.exe\` below and run it. Installed launchers update themselves automatically.
|
|
|
|
**Admin panel (Docker):**
|
|
\`\`\`bash
|
|
docker pull ${IMAGE}:${{ needs.version.outputs.version }}
|
|
\`\`\`
|
|
Or with Compose: set \`image: ${IMAGE}:${{ needs.version.outputs.version }}\` in \`docker-compose.yml\` and run \`docker compose up -d\`.
|
|
NOTES
|
|
- uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ needs.version.outputs.tag }}
|
|
name: ${{ needs.version.outputs.tag }}
|
|
target_commitish: ${{ github.sha }}
|
|
body_path: notes.md
|
|
generate_release_notes: true
|
|
prerelease: ${{ contains(needs.version.outputs.version, '-') }}
|
|
files: dist/*-setup.exe
|