From b781136c34fd8d40d14d276f13bbfcf2611021ab Mon Sep 17 00:00:00 2001 From: Dorian Date: Thu, 26 Mar 2026 09:13:31 +0000 Subject: [PATCH] feat: CI/CD builds both bundled and unbundled ISOs Workflow builds both variants on push to main. Manual trigger lets you choose bundled, unbundled, or both. ISOs auto-copied to FileBrowser /Builds/ folder for easy download. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/build-iso.yml | 109 ++++++++++++++++++++++++++------- 1 file changed, 87 insertions(+), 22 deletions(-) diff --git a/.gitea/workflows/build-iso.yml b/.gitea/workflows/build-iso.yml index 0a3f8cb7..e7fe8590 100644 --- a/.gitea/workflows/build-iso.yml +++ b/.gitea/workflows/build-iso.yml @@ -4,44 +4,109 @@ on: push: branches: [main] workflow_dispatch: + inputs: + variant: + description: 'ISO variant to build' + required: false + default: 'both' + type: choice + options: + - both + - bundled + - unbundled jobs: - build-iso: + build-backend: runs-on: ubuntu-latest - timeout-minutes: 60 + timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v4 - - name: Install Rust toolchain - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: Build backend (release) - run: cargo build --release --manifest-path core/Cargo.toml + run: | + source ~/.cargo/env 2>/dev/null || true + cargo build --release --manifest-path core/Cargo.toml - name: Install backend binary - run: | - sudo cp core/target/release/archipelago /usr/local/bin/archipelago - sudo chmod +x /usr/local/bin/archipelago + run: sudo cp core/target/release/archipelago /usr/local/bin/archipelago + + build-frontend: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@v4 - name: Build frontend - run: | - cd neode-ui - npm ci - npm run build + run: cd neode-ui && npm ci && npm run build - - name: Build ISO + build-bundled-iso: + needs: [build-backend, build-frontend] + if: ${{ github.event.inputs.variant != 'unbundled' }} + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build backend + run: | + source ~/.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 bundled ISO run: | cd image-recipe sudo DEV_SERVER=localhost BUILD_FROM_SOURCE=0 ./build-auto-installer-iso.sh env: DEBIAN_FRONTEND: noninteractive - - name: Upload ISO artifact - uses: actions/upload-artifact@v3 - with: - name: archipelago-iso - path: image-recipe/results/*.iso - retention-days: 30 + - name: Copy to Builds folder + run: | + ISO=$(ls image-recipe/results/archipelago-installer-*.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-bundled-${DATE}.iso" + sudo chown 1000:1000 "/var/lib/archipelago/filebrowser/Builds/archipelago-bundled-${DATE}.iso" + echo "ISO copied to Builds: archipelago-bundled-${DATE}.iso" + fi + + build-unbundled-iso: + needs: [build-backend, build-frontend] + if: ${{ github.event.inputs.variant != 'bundled' }} + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build backend + run: | + source ~/.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 + env: + DEBIAN_FRONTEND: noninteractive + + - name: Copy to Builds folder + 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 copied to Builds: archipelago-unbundled-${DATE}.iso" + fi