Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.0] - 2026-03-13

### Added

- 10 new AI tool recognitions: Grok, Gemini, Jimeng (即梦), Luma, Hailuo (海螺), Pixverse, Genmo, Haiper, Hume, Fish Audio (51 → 61 tools)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aicheck"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
rust-version = "1.86"
description = "Detect AI-generated content via provenance signals (C2PA, XMP/IPTC, EXIF)"
Expand Down
Loading