Migrate CI to Gitea and improve live map diagnostics
CI / Real Minecraft installs (manual) (push) Skipped
CI / Rust, web and container (push) Canceled after 0s
CI / Windows launcher (push) Canceled after 0s
Server integrations / paper (push) Canceled after 0s
Server integrations / Fabric and Forge / 1.20.1 (push) Canceled after 0s
Server integrations / Fabric and Forge / 1.21.1 (push) Canceled after 0s
Server integrations / Fabric and Forge / 26.1.2 (push) Canceled after 0s
Server integrations / Fabric and Forge / 26.2 (push) Canceled after 0s
Server integrations / Fabric and Forge / 26.3 (push) Canceled after 0s

This commit is contained in:
SCOPEDD committed 2026-10-01 00:07:35 -04:00
1 parent d72d7c2e80
commit 7809d47d39
32 files changed
+518 -325

No files matched your search

+93
View File
@@ -0,0 +1,93 @@
name: CI
on:
push:
branches: ['**']
tags-ignore: ['**']
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ gitea.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
verify:
name: Rust, web and container
runs-on: linux-build
steps:
- uses: builtin:checkout
- name: Verify Linux runner
run: |
set -eu
test "$(uname -s)" = Linux
for tool in cargo rustc node npm docker; do command -v "$tool" >/dev/null || { echo "Missing $tool on linux-build runner"; exit 1; }; done
test "$(node -p 'process.versions.node.split(".")[0]')" -ge 22
rustup component list --installed | grep -q rustfmt
rustup component list --installed | grep -q clippy
pkg-config --exists webkit2gtk-4.1 ayatana-appindicator3-0.1 librsvg-2.0 || { echo 'Missing Tauri GTK/WebKit development packages'; exit 1; }
docker info >/dev/null || { echo 'Docker daemon unavailable'; exit 1; }
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: |
panel/web/package-lock.json
launcher/package-lock.json
- name: Check Rust
run: |
mkdir -p launcher/dist
echo '<!doctype html>' > launcher/dist/index.html
cargo fmt --all --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
- name: Check panel and launcher UI
run: |
for app in panel/web launcher; do
(cd "$app" && npm ci --no-audit --no-fund && npm run check && npm run build)
done
- name: Build panel container
run: docker build -t scopenet-panel:ci .
launcher-windows:
name: Windows launcher
runs-on: windows-build
steps:
- uses: builtin:checkout
- name: Verify Windows runner
shell: pwsh
run: |
if (-not $IsWindows) { throw 'windows-build must be a Windows host runner' }
foreach ($tool in @('cargo', 'rustc', 'node', 'npm')) {
if (-not (Get-Command $tool -ErrorAction SilentlyContinue)) { throw "Missing $tool" }
}
if ([int](node -p 'process.versions.node.split(".")[0]') -lt 22) { throw 'Node 22+ required' }
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: launcher/package-lock.json
- run: npm ci --no-audit --no-fund
working-directory: launcher
- run: npm run build
working-directory: launcher
- run: cargo clippy -p scopenet-launcher --locked -- -D warnings
- run: cargo test -p scopenet-launcher -p scopenet-core -p scopenet-shared --locked
engine-online:
name: Real Minecraft installs (manual)
if: ${{ gitea.event_name == 'workflow_dispatch' }}
runs-on: linux-build
continue-on-error: true
steps:
- uses: builtin:checkout
- name: Verify runner
run: |
test "$(uname -s)" = Linux
command -v cargo
- uses: Swatinem/rust-cache@v2
- run: cargo test -p scopenet-core --test online --locked -- --ignored --test-threads=2 --nocapture
+88
View File
@@ -0,0 +1,88 @@
name: Server integrations
on:
push:
branches: ['**']
paths: ['integrations/**', '.gitea/workflows/integrations.yml']
pull_request:
paths: ['integrations/**', '.gitea/workflows/integrations.yml']
workflow_dispatch:
workflow_call:
inputs:
version:
type: string
default: '0.5.0'
permissions:
contents: read
jobs:
paper:
runs-on: linux-build
steps:
- uses: builtin:checkout
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Verify integration runner
run: |
set -eu
test "$(uname -s)" = Linux
command -v java
java -version 2>&1 | grep -q '21\.' || { echo 'Paper needs Java 21'; exit 1; }
- uses: gradle/actions/setup-gradle@v4
with:
gradle-version: '8.10.2'
- run: gradle -p integrations :common:test :paper:build -PreleaseVersion="${{ inputs.version || '0.5.0' }}"
- uses: actions/upload-artifact@v4
with:
name: server-paper
path: integrations/paper/build/libs/scopenet-paper-*.jar
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: failure()
with:
name: integration-test-reports
path: integrations/common/build/reports/tests/
mods:
name: Fabric and Forge / ${{ matrix.mc.version }}
runs-on: linux-build
strategy:
fail-fast: false
matrix:
mc:
- { version: '1.20.1', java: '21', gradle: '8.10.2' }
- { version: '1.21.1', java: '21', gradle: '8.10.2' }
- { version: '26.1.2', java: '25', gradle: '9.6.0' }
- { version: '26.2', java: '25', gradle: '9.6.0' }
- { version: '26.3', java: '25', gradle: '9.6.0' }
steps:
- uses: builtin:checkout
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.mc.java }}
- name: Verify integration runner
run: |
set -eu
test "$(uname -s)" = Linux
command -v java
java -version 2>&1 | grep -q '${{ matrix.mc.java }}\.' || { echo 'Wrong Java version for this matrix entry'; exit 1; }
- uses: gradle/actions/setup-gradle@v4
with:
gradle-version: ${{ matrix.mc.gradle }}
- name: Build both loaders
run: |
for loader in fabric forge; do
gradle -p integrations -Ploader="$loader" -PmcVersion=${{ matrix.mc.version }} -PreleaseVersion="${{ inputs.version || '0.5.0' }}" :"$loader":build
done
- name: Audit Fabric startup hooks
run: gradle -p integrations -Ploader=fabric -PmcVersion=${{ matrix.mc.version }} -PreleaseVersion="${{ inputs.version || '0.5.0' }}" -PverifyMixins=true :fabric:runServer
- uses: actions/upload-artifact@v4
with:
name: server-mods-${{ matrix.mc.version }}
path: |
integrations/fabric/build/libs/scopenet-fabric-${{ matrix.mc.version }}-*.jar
integrations/forge/build/libs/scopenet-forge-${{ matrix.mc.version }}-*.jar
if-no-files-found: error
+213
View File
@@ -0,0 +1,213 @@
name: Release
# Publish by pushing a tag to the gitea remote (`git push gitea v0.5.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: read
releases: write
packages: write
env:
CARGO_TERM_COLOR: always
jobs:
version:
runs-on: linux-build
outputs:
version: ${{ steps.v.outputs.version }}
tag: ${{ steps.v.outputs.tag }}
steps:
- name: Verify Linux runner
run: |
test "$(uname -s)" = Linux
command -v bash
- id: v
shell: bash
env:
INPUT_VERSION: ${{ inputs.version }}
run: |
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then v="$INPUT_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" >> "$GITEA_OUTPUT"
echo "tag=v$v" >> "$GITEA_OUTPUT"
launcher:
name: Windows installer
needs: version
runs-on: windows-build
steps:
- uses: builtin:checkout
- name: Verify Windows runner
shell: pwsh
run: |
if (-not $IsWindows) { throw 'windows-build must be a Windows host runner' }
foreach ($tool in @('cargo', 'node', 'npm')) {
if (-not (Get-Command $tool -ErrorAction SilentlyContinue)) { throw "Missing $tool" }
}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: release
- uses: actions/setup-node@v4
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: ${{ gitea.server_url }}/${{ gitea.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 (Gitea registry)
needs: version
runs-on: linux-build
steps:
- uses: builtin:checkout
- name: Verify container runner
run: |
test "$(uname -s)" = Linux
command -v docker
docker info >/dev/null
docker buildx version >/dev/null
- name: Image name
run: echo "IMAGE=${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY_OWNER,,}/scopenet-mc-panel" >> "$GITEA_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: gitea.jadonsandbox.com
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_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=registry,ref=${{ env.IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max
server-integrations:
needs: version
uses: ./.gitea/workflows/integrations.yml
with:
version: ${{ needs.version.outputs.version }}
release:
name: Gitea release
needs: [version, launcher, panel-image, server-integrations]
runs-on: linux-build
steps:
- name: Verify release runner
run: |
test "$(uname -s)" = Linux
command -v curl
command -v jq
- uses: actions/download-artifact@v4
with:
name: windows-installer
path: dist
- uses: actions/download-artifact@v4
with:
pattern: server-*
merge-multiple: true
path: dist
- name: Release notes
run: |
IMAGE="${GITHUB_SERVER_URL#https://}/${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.
**Servers:** download \`scopenet-paper\` or the Fabric/Forge JAR for your exact Minecraft version. Keep \`online-mode=true\` and install authlib-injector as documented in \`docs/server-integration.md\`.
**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
- name: Publish Gitea release and assets
env:
TOKEN: ${{ secrets.GITEA_TOKEN }}
TAG: ${{ needs.version.outputs.tag }}
VERSION: ${{ needs.version.outputs.version }}
run: |
set -euo pipefail
command -v curl && command -v jq
test -n "$TOKEN" || { echo 'GITEA_TOKEN is unavailable'; exit 1; }
api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases"
body=$(jq -n --arg tag "$TAG" --arg notes "$(cat notes.md)" --arg sha "$GITHUB_SHA" --argjson pre "$(case "$VERSION" in *-*) echo true;; *) echo false;; esac)" '{tag_name:$tag,name:$tag,body:$notes,target_commitish:$sha,prerelease:$pre}')
release=$(curl -fsS -H "Authorization: token $TOKEN" "$api/tags/$TAG") || \
release=$(curl --fail-with-body -sS -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' -d "$body" "$api")
id=$(printf '%s' "$release" | jq -er '.id')
for file in dist/*-setup.exe dist/*.jar; do
test -f "$file" || continue
if printf '%s' "$release" | jq -e --arg name "$(basename "$file")" '.assets[]? | select(.name == $name)' >/dev/null; then continue; fi
curl --fail-with-body -sS -H "Authorization: token $TOKEN" -F "attachment=@$file" "$api/$id/assets?name=$(basename "$file")" >/dev/null
done