Skip to content

feat: add contribai logs command — tail events.jsonl from CLI (v6.6.0) #74

feat: add contribai logs command — tail events.jsonl from CLI (v6.6.0)

feat: add contribai logs command — tail events.jsonl from CLI (v6.6.0) #74

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g., v5.13.0)'
required: true
type: string
jobs:
# ── Rust binary release (v5+) ─────────────────────────────────────────────────
release-rust:
name: Build Rust Binary
if: startsWith(github.ref_name, 'v5') || startsWith(github.ref_name, 'v6') || startsWith(github.ref_name, 'v7') || startsWith(github.ref_name, 'v8') || startsWith(github.ref_name, 'v9')
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
suffix: linux-x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: windows-x86_64.exe
- os: macos-latest
target: x86_64-apple-darwin
suffix: macos-x86_64
- os: macos-latest
target: aarch64-apple-darwin
suffix: macos-aarch64
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
crates/contribai-rs/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
- name: Rename binary (Linux/macOS)
if: runner.os != 'Windows'
run: |
cp target/${{ matrix.target }}/release/contribai \
contribai-${{ github.ref_name }}-${{ matrix.suffix }}
- name: Rename binary (Windows)
if: runner.os == 'Windows'
run: |
Copy-Item target/${{ matrix.target }}/release/contribai.exe `
contribai-${{ github.ref_name }}-${{ matrix.suffix }}
- name: Extract release notes
id: notes
shell: bash
run: |
TAG="${GITHUB_REF#refs/tags/v}"
NOTES=$(awk "/^## \[$TAG\]/{found=1; next} /^## \[/{if(found) exit} found" CHANGELOG.md)
if [ -z "$NOTES" ]; then
NOTES="See [CHANGELOG.md](https://github.com/$GITHUB_REPOSITORY/blob/main/CHANGELOG.md) for details."
fi
echo "$NOTES" > /tmp/release_notes.md
echo "notes_file=/tmp/release_notes.md" >> $GITHUB_OUTPUT
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: contribai-${{ github.ref_name }}-${{ matrix.suffix }}
body_path: ${{ steps.notes.outputs.notes_file }}
# ── Python legacy release (v4 and below) ─────────────────────────────────────
release-python:
name: Build Python Package
if: startsWith(github.ref_name, 'v4') || startsWith(github.ref_name, 'v3') || startsWith(github.ref_name, 'v2') || startsWith(github.ref_name, 'v1') || startsWith(github.ref_name, 'v0')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install build tools
run: pip install build twine
- name: Build package
run: python -m build
- name: Check package
run: twine check dist/*
- name: Extract release notes from CHANGELOG
id: changelog
run: |
TAG="${GITHUB_REF#refs/tags/v}"
NOTES=$(awk "/^## \[$TAG\]/{found=1; next} /^## \[/{if(found) exit} found" CHANGELOG.md)
if [ -z "$NOTES" ]; then
NOTES="Release $TAG — see [CHANGELOG.md](https://github.com/$GITHUB_REPOSITORY/blob/main/CHANGELOG.md) for details."
fi
echo "$NOTES" > /tmp/release_notes.md
echo "notes_file=/tmp/release_notes.md" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
body_path: ${{ steps.changelog.outputs.notes_file }}