Add Windows x64 Electron build with precompiled acestep.cpp binaries #96
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| ACESTEP_CPP_REPO: https://github.com/audiohacking/acestep.cpp.git | |
| jobs: | |
| # ───────────────────────────────────────────── | |
| # 1. React / Vite frontend | |
| # ───────────────────────────────────────────── | |
| frontend: | |
| name: Frontend (TypeScript + Vite build) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm install | |
| - name: TypeScript check | |
| run: ./node_modules/.bin/tsc --noEmit | |
| - name: Vite build | |
| run: npm run build | |
| - name: Upload frontend artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-dist | |
| path: dist/ | |
| retention-days: 7 | |
| # ───────────────────────────────────────────── | |
| # 2. Node.js Express server | |
| # ───────────────────────────────────────────── | |
| server: | |
| name: Server (TypeScript compile) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: server | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: server/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: TypeScript check | |
| run: npx tsc --noEmit | |
| - name: TypeScript compile | |
| run: npm run build | |
| - name: Upload server artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: server-dist | |
| path: server/dist/ | |
| retention-days: 7 | |
| # ───────────────────────────────────────────── | |
| # 3. Test build.sh (the deployment build script) | |
| # Validates that build.sh correctly clones | |
| # acestep.cpp, compiles it, and installs the | |
| # binaries to bin/ — exactly as it will run | |
| # on the end user's machine at first launch. | |
| # ───────────────────────────────────────────── | |
| test-build-script: | |
| name: Test build.sh (${{ matrix.label }}) | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - label: linux-x64 | |
| runner: ubuntu-22.04 | |
| os: linux | |
| - label: macos-arm64 | |
| runner: macos-14 | |
| os: macos | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # ── Install build prerequisites (same as a user would need) ────────── | |
| - name: Install build tools (Linux) | |
| if: matrix.os == 'linux' | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y cmake libssl-dev pkg-config | |
| - name: Install build tools (macOS) | |
| if: matrix.os == 'macos' | |
| run: brew install cmake | |
| # ── Cache the acestep.cpp build directory ──────────────────────────── | |
| - name: Cache acestep.cpp build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| acestep.cpp | |
| bin | |
| key: build-script-${{ matrix.label }}-${{ hashFiles('build.sh') }}-${{ env.ACESTEP_CPP_REPO }} | |
| restore-keys: build-script-${{ matrix.label }}- | |
| # ── Run the real deployment build script (CPU-only on CI runners) ──── | |
| - name: Run build.sh | |
| run: bash build.sh --cpu | |
| # ── Verify expected binaries were installed to bin/ ────────────────── | |
| - name: Verify installed binaries | |
| shell: bash | |
| run: | | |
| ALL_OK=1 | |
| for bin in ace-lm ace-synth neural-codec; do | |
| if [ -x "bin/$bin" ]; then | |
| echo "✅ bin/$bin" | |
| else | |
| echo "⚠️ bin/$bin not found or not executable" | |
| ALL_OK=0 | |
| fi | |
| done | |
| [ "$ALL_OK" = "1" ] || { echo "One or more binaries missing"; exit 1; } | |
| - name: Upload binaries artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ci-bin-${{ matrix.label }} | |
| path: bin/ | |
| if-no-files-found: warn | |
| retention-days: 7 | |