name: Build Avida-ED Onefile on: workflow_dispatch: inputs: ed_versions: description: "Comma-separated versions (v3,v4)" default: "v3,v4" required: true jobs: build: strategy: fail-fast: false matrix: os: [ubuntu-22.04, windows-2022, macos-13] ver: [v3, v4] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Set up Rust uses: dtolnay/rust-toolchain@stable - name: Fetch assets via docker compose (using URL fallback on mac/win if docker unavailable) shell: bash run: | if command -v docker >/dev/null 2>&1; then docker compose run --rm fetch-${{ matrix.ver }} else MODE=url URL=https://avida-ed.msu.edu/app4/ OUTDIR=./apps/${{ matrix.ver }} bash tools/fetch_assets.sh fi - name: Inject webroot run: | rm -rf server-ui/webroot mkdir -p server-ui/webroot rsync -a apps/${{ matrix.ver }}/Avida-ED-Eco/ server-ui/webroot/Avida-ED-Eco/ - name: Build binary run: | cd server-ui cargo build --release - name: Package (Linux AppImage) if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update && sudo apt-get install -y imagemagick || true bash packaging/linux/make_appimage.sh ${{ matrix.ver }} server-ui/target/release/avidaed_onefile mv Avida-ED-${{ matrix.ver }}-Linux-x86_64.AppImage Avida-ED-${{ matrix.ver }}-Linux-x86_64.AppImage - name: Package (Windows EXE) if: startsWith(matrix.os, 'windows') shell: powershell run: | $WV2 = "$env:RUNNER_TEMP\WebView2Fixed" # pre-cached in your org, or downloaded here # TODO: fetch/unzip WebView2 Fixed into $WV2 if not cached powershell -ExecutionPolicy Bypass -File packaging/windows/make_windows_sfx.ps1 ` -Version ${{ matrix.ver }} ` -BinPath server-ui/target/release/avidaed_onefile.exe ` -WV2Fixed $WV2 Move-Item packaging\windows\Avida-ED-${{ matrix.ver }}-Windows.exe . - name: Package (macOS .app) if: startsWith(matrix.os, 'macos') run: | bash packaging/mac/make_macos_bundle.sh ${{ matrix.ver }} server-ui/target/release/avidaed_onefile # Optionally make a DMG # brew install create-dmg # create-dmg "Avida-ED-${{ matrix.ver }}.app" - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: Avida-ED-${{ matrix.ver }}-${{ matrix.os }} path: | *.AppImage *.exe Avida-ED-${{ matrix.ver }}.app if-no-files-found: ignore