archy/.gitea/workflows/build-iso.yml
Dorian e96acc9023 fix: CI checkout cd to home before cleanup to avoid cwd error
The runner cwd is the workspace itself, so deleting it removes the
shell's cwd. cd to home first, then clean workspace before clone.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:24:24 +00:00

51 lines
1.8 KiB
YAML

name: Build Archipelago ISO
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build-iso:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
run: |
cd /home/archipelago
WORKSPACE="${GITHUB_WORKSPACE}"
CLONE_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
if [ -n "$GITHUB_TOKEN" ]; then
CLONE_URL=$(echo "$CLONE_URL" | sed "s|https://|https://token:${GITHUB_TOKEN}@|")
fi
[ -d "$WORKSPACE" ] && find "$WORKSPACE" -mindepth 1 -delete
git clone --depth 1 --branch "${GITHUB_REF_NAME:-main}" "$CLONE_URL" "$WORKSPACE"
cd "$WORKSPACE"
echo "Checked out $(git rev-parse --short HEAD) on ${GITHUB_REF_NAME:-main}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build backend
run: |
source $HOME/.cargo/env 2>/dev/null || true
cargo build --release --manifest-path core/Cargo.toml
sudo cp core/target/release/archipelago /usr/local/bin/archipelago
- name: Build frontend
run: cd neode-ui && npm ci && npm run build
- name: Build unbundled ISO
run: |
cd image-recipe
sudo UNBUNDLED=1 DEV_SERVER=localhost BUILD_FROM_SOURCE=0 ./build-auto-installer-iso.sh
- name: Copy to Builds
run: |
ISO=$(ls image-recipe/results/archipelago-installer-unbundled-*.iso 2>/dev/null | head -1)
if [ -n "$ISO" ]; then
DATE=$(date +%Y%m%d-%H%M)
sudo cp "$ISO" "/var/lib/archipelago/filebrowser/Builds/archipelago-unbundled-${DATE}.iso"
sudo chown 1000:1000 "/var/lib/archipelago/filebrowser/Builds/archipelago-unbundled-${DATE}.iso"
echo "ISO: archipelago-unbundled-${DATE}.iso"
fi