From 6f4107d5576d2ec4a5d0b3140502f9c50d10c08a Mon Sep 17 00:00:00 2001 From: Alex Schokking Date: Sat, 7 Nov 2026 14:26:21 -0800 Subject: [PATCH] Add Team 488 build workflow with rolling pre-release Builds a Windows x64 installer on pushes to main, PRs, and manual runs. On main, it replaces the "team-latest" pre-release so the download link stays the same. The build installs as "AdvantageScope (Team 488)" with its own app ID and settings, so it can sit alongside an official install. The version gets a "-team488." suffix, and update checks and GitHub links point at this fork. These are applied at build time so upstream files stay unmodified and merges from Mechanical-Advantage stay conflict-free. Upstream's build.yml and publish-docs.yml should be disabled on the fork. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/team-build.yml | 153 +++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 .github/workflows/team-build.yml diff --git a/.github/workflows/team-build.yml b/.github/workflows/team-build.yml new file mode 100644 index 000000000..cf94037d9 --- /dev/null +++ b/.github/workflows/team-build.yml @@ -0,0 +1,153 @@ +# Team 488 build: Windows x64 installer, published as a rolling +# "team-latest" pre-release on every push to main. +# +# Kept separate from upstream's build.yml (disabled on this fork) so +# merges from Mechanical-Advantage/AdvantageScope don't conflict. + +name: Team 488 Build + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: team-build-${{ github.ref }} + cancel-in-progress: true + +env: + RELEASE_TAG: team-latest + APP_ID: org.team488.advantagescope + PRODUCT_NAME: AdvantageScope (Team 488) + INSTALLER_NAME: advantagescope-team488-win-x64.exe + +jobs: + check-formatting: + name: Check Formatting + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: "20.x" + cache: "npm" + - name: Install Node.js dependencies + run: npm ci + env: + YOUTUBE_DL_SKIP_DOWNLOAD: "true" + - name: Check formatting + run: npm run check-format + + compile: + name: Compile + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: "20.x" + cache: "npm" + - name: Setup Emscripten + uses: emscripten-core/setup-emsdk@v16 + with: + version: 4.0.12 + - name: Install Node.js dependencies + run: npm ci + env: + YOUTUBE_DL_SKIP_DOWNLOAD: "true" + - name: Point update checks and GitHub links at this fork + run: | + sed -i 's|GITHUB_REPOSITORY = "Mechanical-Advantage/AdvantageScope"|GITHUB_REPOSITORY = "${{ github.repository }}"|' src/main/github.ts + grep -q 'GITHUB_REPOSITORY = "${{ github.repository }}"' src/main/github.ts + - name: Compile WebAssembly + run: npm run wasm:compile + - name: Compile bundles + run: npm run compile + - name: Upload bundles + uses: actions/upload-artifact@v7 + with: + name: bundles + path: | + bundles/**/*.js + bundles/**/*.wasm + + build-win: + name: Build for Windows (x64) + needs: compile + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: "20.x" + cache: "npm" + - name: Install Node.js dependencies + run: npm ci + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Download bundles + uses: actions/download-artifact@v8 + with: + name: bundles + path: bundles + - name: Build documentation + run: npm run docs:build-embed + - name: Determine version + shell: bash + run: echo "APP_VERSION=$(node -p 'require("./package.json").version')-team488.${{ github.run_number }}" >> $GITHUB_ENV + - name: Build app + shell: bash + run: > + npx electron-builder build --x64 --publish never + -c.appId="$APP_ID" + -c.productName="$PRODUCT_NAME" + -c.extraMetadata.productName="$PRODUCT_NAME" + -c.extraMetadata.version="$APP_VERSION" + env: + NODE_OPTIONS: --max-old-space-size=4096 + ELECTRON_BUILDER_7Z_FILTER: BCJ # https://github.com/electron-userland/electron-builder/issues/9983 + - name: Prepare artifact + shell: bash + run: mv dist/AdvantageScope*.exe "$INSTALLER_NAME" + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + archive: false + path: ${{ env.INSTALLER_NAME }} + - name: Publish rolling pre-release + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + shell: bash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cat > notes.md <