Skip to content

Add comprehensive AI test dataset with 48 integration tests and CI/CD… #3

Add comprehensive AI test dataset with 48 integration tests and CI/CD…

Add comprehensive AI test dataset with 48 integration tests and CI/CD… #3

Workflow file for this run

name: Release
on:
push:
branches: [main]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Read version from Cargo.toml
id: version
run: |
VERSION=$(grep -m1 '^version' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Detected version: $VERSION"
- name: Check if release is needed
id: check
run: |
VERSION="${{ steps.version.outputs.version }}"
PATCH=$(echo "$VERSION" | cut -d. -f3)
TAG="v$VERSION"
if [ "$PATCH" != "0" ]; then
echo "Patch version is $PATCH (not 0) -- skipping release."
echo "should_release=false" >> "$GITHUB_OUTPUT"
exit 0
fi
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists -- skipping release."
echo "should_release=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "Will release $TAG"
echo "should_release=true" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Extract changelog for this version
if: steps.check.outputs.should_release == 'true'
id: changelog
run: |
VERSION="${{ steps.version.outputs.version }}"
awk "/^## \\[$VERSION\\]/{found=1; next} /^## \\[/{if(found) exit} found{print}" CHANGELOG.md > /tmp/release-notes.md
echo "Extracted changelog:"
cat /tmp/release-notes.md
- name: Create git tag
if: steps.check.outputs.should_release == 'true'
run: |
git tag "${{ steps.check.outputs.tag }}"
git push origin "${{ steps.check.outputs.tag }}"
- name: Create GitHub Release
if: steps.check.outputs.should_release == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ steps.check.outputs.tag }}" \
--title "${{ steps.check.outputs.tag }}" \
--notes-file /tmp/release-notes.md
- uses: dtolnay/rust-toolchain@stable
if: steps.check.outputs.should_release == 'true'
- name: Publish to crates.io
if: steps.check.outputs.should_release == 'true'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish