mirror of
https://github.com/mistralai/mistral-vibe
synced 2026-04-25 17:14:55 +02:00
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Gauthier Guinet <43207538+Gguinet@users.noreply.github.com> Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai> Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com> Co-authored-by: Quentin <torroba.q@gmail.com> Co-authored-by: Simon <80467011+sorgfresser@users.noreply.github.com> Co-authored-by: Simon Van de Kerckhove <simon.vandekerckhove@mistral.ai> Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com> Co-authored-by: angelapopopo <angele.lenglemetz@mistral.ai> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
160 lines
5.4 KiB
YAML
160 lines
5.4 KiB
YAML
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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
|
|
|
- name: Install uv with caching
|
|
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
|
|
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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
|
|
|
- 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
|