name: Build and upload on: release: types: [published] pull_request: branches: [main] workflow_dispatch: jobs: configure: runs-on: ubuntu-latest permissions: contents: read outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - name: Set matrix id: set-matrix run: | if [[ "${{ github.repository }}" == "mistralai/mistral-vibe" ]]; then matrix='{ "include": [ {"runner": "ubuntu-22.04", "os": "linux", "arch": "x86_64"}, {"runner": "ubuntu-22.04-arm", "os": "linux", "arch": "aarch64"}, {"runner": "macos-15-intel", "os": "darwin", "arch": "x86_64"}, {"runner": "macos-14", "os": "darwin", "arch": "aarch64"}, {"runner": "windows-2022", "os": "windows", "arch": "x86_64"}, {"runner": "windows-11-arm", "os": "windows", "arch": "aarch64"} ] }' else # skip ARM Linux/Windows (runners not available on non public repos) matrix='{ "include": [ {"runner": "ubuntu-22.04", "os": "linux", "arch": "x86_64"}, {"runner": "macos-15-intel", "os": "darwin", "arch": "x86_64"}, {"runner": "macos-14", "os": "darwin", "arch": "aarch64"}, {"runner": "windows-2022", "os": "windows", "arch": "x86_64"} ] }' fi echo "matrix=$(echo $matrix | jq -c .)" >> $GITHUB_OUTPUT build-and-upload: needs: configure name: ${{ matrix.os }}-${{ matrix.arch }} permissions: contents: read strategy: matrix: ${{ fromJSON(needs.configure.outputs.matrix) }} runs-on: ${{ matrix.runner }} steps: - name: echo run: echo github.repository=${{ github.repository }} - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - name: Install uv with caching uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7 with: version: "latest" enable-cache: true cache-dependency-glob: "uv.lock" - name: Install Python run: uv python install 3.12 - name: Sync dependencies run: uv sync --no-dev --group build - name: Build with PyInstaller run: uv run --no-dev --group build pyinstaller vibe-acp.spec - name: Get package version with uv (Unix) id: get_version_unix if: ${{ matrix.os != 'windows' }} run: python -c "import subprocess; version = subprocess.check_output(['uv', 'version']).decode().split()[1]; print(f'version={version}')" >> $GITHUB_OUTPUT - name: Get package version with uv (Windows) id: get_version_windows if: ${{ matrix.os == 'windows' }} shell: pwsh run: python -c "import subprocess; version = subprocess.check_output(['uv', 'version']).decode().split()[1]; print(f'version={version}')" >> $env:GITHUB_OUTPUT - name: Smoke test bundled binary (Unix) if: ${{ matrix.os != 'windows' }} run: ./dist/vibe-acp-dir/vibe-acp --version - name: Smoke test bundled binary (Windows) if: ${{ matrix.os == 'windows' }} shell: pwsh run: .\dist\vibe-acp-dir\vibe-acp.exe --version - name: Upload binary as artifact uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 with: name: vibe-acp-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.os == 'windows' && steps.get_version_windows.outputs.version || steps.get_version_unix.outputs.version }} path: dist/vibe-acp-dir/ attach-to-release: needs: build-and-upload runs-on: ubuntu-latest if: github.event_name == 'release' permissions: contents: write steps: - name: Download all artifacts uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5 with: path: artifacts - name: Zip artifacts run: | mkdir release-assets for dir in artifacts/*; do name=$(basename "$dir") if [ -f "$dir/vibe-acp" ] || [ -f "$dir/vibe-acp.exe" ]; then chmod -f +x "$dir/vibe-acp" 2>/dev/null || true (cd "$dir" && zip -r "../../release-assets/${name}.zip" .) fi done - name: Attach binaries to release uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2 with: files: release-assets/*.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} nix-build: needs: configure name: "Nix: ${{ matrix.os }}-${{ matrix.arch }}" permissions: contents: read strategy: matrix: ${{ fromJSON(needs.configure.outputs.matrix) }} runs-on: ${{ matrix.runner }} steps: - name: Checkout repository if: matrix.os != 'windows' uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - name: Install Nix if: matrix.os != 'windows' uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31 - name: Build with Nix if: matrix.os != 'windows' shell: bash run: | nix build .# - name: Nix Smoke Test if: matrix.os != 'windows' shell: bash run: | nix run .# -- --version