Skip to content

Conversation

@RAprogramm
Copy link
Owner

Summary

Implemented fully automated release process with professional changelog generation from commits. No manual work required - just bump version in Cargo.toml and merge to main.

How It Works

Trigger

  • Runs automatically after successful CI on main branch
  • Uses workflow_run event to wait for CI completion

Version Check

  1. Extracts version from Cargo.toml
  2. Fetches current version from crates.io API
  3. Compares using semver (handles prerelease correctly)
  4. Proceeds only if local version > crates.io version

Changelog Generation

Parses all commits since last release and groups by conventional commit type:

Supported types:

  • feat: → Features
  • fix: → Bug Fixes
  • perf: → Performance
  • refactor: → Refactoring
  • docs: → Documentation
  • test: → Tests
  • ci: → CI/CD
  • chore: → Chore
  • Everything else → Other Changes

Features:

  • Extracts issue numbers from commit messages
  • Creates clickable links to commits and issues
  • Filters out [skip ci] and readme auto-refresh commits
  • Generates comparison link between versions
  • Professional markdown formatting

Release Creation

  1. Creates annotated Git tag (e.g., v0.24.19)
  2. Pushes tag to origin
  3. Creates GitHub release with:
    • Version as title
    • Generated changelog as body
    • Links to all commits and issues
    • Comparison with previous version

Integration

  • Existing release.yml workflow automatically triggers on tag push
  • Publishes to crates.io with version checking
  • Complete end-to-end automation

Example Changelog Output

## Changes

### Features

- add supply chain security with SBOM and Sigstore (#192) ([#187](https://github.com/RAprogramm/masterror/issues/187)) [`51f3964`](...)
- add Codecov configuration (#191) ([#189](https://github.com/RAprogramm/masterror/issues/189)) [`3a5e651`](...)
- add multi-platform testing (#188) ([#186](https://github.com/RAprogramm/masterror/issues/186)) [`fa4c576`](...)

### CI/CD

- upgrade codecov action to v5 [`e7673e1`](...)

### Other Changes

- Merge branch 181 - complete codecov integration [`1e00c8d`](...)

---

**Full Changelog**: https://github.com/RAprogramm/masterror/compare/v0.24.18...v0.24.19

Workflow

Before:

  1. Bump version in Cargo.toml
  2. Merge to main
  3. Manually create tag: git tag v* && git push origin v*
  4. Manually write changelog
  5. Manually create GitHub release
  6. Workflow publishes to crates.io

After:

  1. Bump version in Cargo.toml
  2. Merge to main
  3. ✨ Everything else happens automatically ✨

Test Plan

  • Workflow YAML validated
  • Changelog generation tested locally
  • Semver comparison tested with various scenarios
  • Conventional commit parsing verified
  • Issue extraction and linking tested
  • All following instructions (no AI mentions, English only)

Benefits

  • Zero Manual Work: Complete automation from version bump to release
  • Professional Changelogs: Consistent format, grouped by type
  • Never Miss Releases: Automatic detection when version bumped
  • Complete Audit Trail: All commits and issues linked
  • Seamless Integration: Works with existing workflows

Next Steps

After merge, next version bump will trigger automatic release with changelog.

Closes #195

Implement fully automated release process with professional changelog generation.

Changes:
- Add auto-release workflow triggered after successful CI on main
- Automatic version comparison with crates.io using semver
- Generate changelog from commits grouped by conventional commit type
- Create and push Git tags automatically
- Create GitHub releases with generated changelog
- Integrate with existing release.yml for crates.io publishing

Changelog generation features:
- Parse commits since last release
- Group by type: feat, fix, perf, refactor, docs, test, ci, chore
- Extract issue numbers and create links
- Filter out [skip ci] and readme auto-refresh commits
- Handle uncategorized commits in "Other Changes" section
- Generate comparison links between versions

Workflow logic:
- Only triggers on successful CI completion
- Checks if local version > crates.io version
- Skips if versions are equal
- Creates annotated tag with version
- Generates professional markdown changelog
- Creates GitHub release with all details

Benefits:
- Zero manual work for releases
- Consistent and professional changelogs
- Never miss a release
- Complete audit trail with commit and issue links
- Seamless integration with existing workflows
@RAprogramm RAprogramm merged commit d3963fc into main Oct 12, 2025
3 checks passed
@RAprogramm RAprogramm deleted the 195 branch October 12, 2025 09:12
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +23 to +25
- uses: actions/checkout@v5
with:
fetch-depth: 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Check out tested commit in workflow_run

This workflow is triggered by a workflow_run of CI, but the checkout step pulls the default branch head without specifying the triggering SHA. If new commits land on main before this job runs, the release will tag whatever happens to be the latest commit—even if its CI has not completed successfully. That risks publishing untested code. Bind actions/checkout to ref: ${{ github.event.workflow_run.head_sha }} so the release uses the same commit whose CI succeeded.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate releases with changelog generation from commits

2 participants