ci: fix windows shell and intel mac runner label #2
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: Release Binaries | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| branches: | |
| - "version/**" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.target }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| archive_ext: tar.gz | |
| - os: macos-15-intel | |
| target: x86_64-apple-darwin | |
| archive_ext: tar.gz | |
| - os: macos-14 | |
| target: aarch64-apple-darwin | |
| archive_ext: tar.gz | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| archive_ext: zip | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Build release binaries | |
| shell: bash | |
| run: | | |
| cargo build --release --target ${{ matrix.target }} \ | |
| -p orchestrator-cli \ | |
| -p agent-runner \ | |
| -p llm-cli-wrapper \ | |
| -p llm-mcp-server | |
| - name: Compute release version | |
| id: version | |
| shell: bash | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| VERSION="${GITHUB_REF_NAME}" | |
| else | |
| BRANCH_SANITIZED="${GITHUB_REF_NAME//\//-}" | |
| VERSION="${BRANCH_SANITIZED}-${GITHUB_SHA::7}" | |
| fi | |
| echo "value=${VERSION}" >> "${GITHUB_OUTPUT}" | |
| - name: Package artifact (unix) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| VERSION="${{ steps.version.outputs.value }}" | |
| TARGET="${{ matrix.target }}" | |
| STAGE_DIR="ao-${VERSION}-${TARGET}" | |
| mkdir -p "${STAGE_DIR}" | |
| cp "target/${TARGET}/release/ao" "${STAGE_DIR}/" | |
| cp "target/${TARGET}/release/agent-runner" "${STAGE_DIR}/" | |
| cp "target/${TARGET}/release/llm-cli-wrapper" "${STAGE_DIR}/" | |
| cp "target/${TARGET}/release/llm-mcp-server" "${STAGE_DIR}/" | |
| tar -czf "${STAGE_DIR}.tar.gz" "${STAGE_DIR}" | |
| - name: Package artifact (windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $Version = "${{ steps.version.outputs.value }}" | |
| $Target = "${{ matrix.target }}" | |
| $StageDir = "ao-$Version-$Target" | |
| New-Item -ItemType Directory -Path $StageDir -Force | Out-Null | |
| Copy-Item "target/$Target/release/ao.exe" "$StageDir/" | |
| Copy-Item "target/$Target/release/agent-runner.exe" "$StageDir/" | |
| Copy-Item "target/$Target/release/llm-cli-wrapper.exe" "$StageDir/" | |
| Copy-Item "target/$Target/release/llm-mcp-server.exe" "$StageDir/" | |
| Compress-Archive -Path $StageDir -DestinationPath "$StageDir.zip" -Force | |
| - name: Upload artifact (unix) | |
| if: runner.os != 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ao-${{ steps.version.outputs.value }}-${{ matrix.target }} | |
| path: ao-${{ steps.version.outputs.value }}-${{ matrix.target }}.tar.gz | |
| - name: Upload artifact (windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ao-${{ steps.version.outputs.value }}-${{ matrix.target }} | |
| path: ao-${{ steps.version.outputs.value }}-${{ matrix.target }}.zip | |
| publish: | |
| name: Publish GitHub release (tags only) | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Generate checksums | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| find dist -type f \( -name '*.tar.gz' -o -name '*.zip' \) -print0 | sort -z | xargs -0 sha256sum > dist/SHA256SUMS.txt | |
| - name: Publish release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| dist/**/*.tar.gz | |
| dist/**/*.zip | |
| dist/SHA256SUMS.txt | |
| generate_release_notes: true |