Skip to content

Commit e6b26d5

Browse files
authored
feat: set up release-plz for automated versioning and changelog (#74)
Configures release-plz to automate the release workflow: - GitHub Action (.github/workflows/release-plz.yml) runs on push to main - Analyzes conventional commits to determine version bumps - Opens release PRs with version bump and changelog updates - On merge: creates git tag, publishes to crates.io, triggers cargo-dist - Runs cargo-semver-checks to catch breaking API changes Also adds: - release-plz.toml configuration (publish, changelog, semver checks) - cliff.toml for git-cliff changelog generation with grouped sections - CHANGELOG.md with initial unreleased features Conventional commit format: - feat: → minor bump, fix: → patch bump - feat!: or BREAKING CHANGE: → major bump - chore:, docs:, ci: → no bump Fixes #68
1 parent 4dfcb51 commit e6b26d5

File tree

4 files changed

+117
-0
lines changed

4 files changed

+117
-0
lines changed

.github/workflows/release-plz.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release-plz
2+
3+
permissions:
4+
pull-requests: write
5+
contents: write
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
release-plz:
14+
name: Release-plz
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Install Rust toolchain
23+
uses: dtolnay/rust-toolchain@stable
24+
25+
- name: Run release-plz
26+
uses: release-plz/action@v0.5
27+
with:
28+
command: release-pr
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Features
11+
12+
- Universal data format converter with mapping language
13+
- Support for JSON, YAML, TOML, CSV, XML, MessagePack, JSON Lines formats
14+
- Mapping language with rename, select, drop, set, cast, where, each, when, flatten, nest, sort, default operations
15+
- 30+ built-in functions (string, math, collection, type operations)
16+
- Streaming mode for large files (JSONL, CSV, JSON array)
17+
- Shell completions for bash, zsh, fish, PowerShell, elvish
18+
- Error UX with "did you mean?" suggestions for formats and functions
19+
- Performance benchmark suite with Criterion
20+
- cargo-dist setup for automated release builds

cliff.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# git-cliff configuration for changelog generation
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
header = """
6+
# Changelog
7+
8+
All notable changes to this project will be documented in this file.
9+
10+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
11+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
12+
13+
"""
14+
body = """
15+
{% if version -%}
16+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
17+
{% else -%}
18+
## [Unreleased]
19+
{% endif -%}
20+
21+
{% for group, commits in commits | group_by(attribute="group") %}
22+
### {{ group | upper_first }}
23+
{% for commit in commits %}
24+
- {% if commit.breaking %}**BREAKING**: {% endif %}{{ commit.message | upper_first }} \
25+
([{{ commit.id | truncate(length=7, end="") }}](https://github.com/alvinreal/morph/commit/{{ commit.id }}))\
26+
{% endfor %}
27+
{% endfor %}
28+
"""
29+
trim = true
30+
31+
[git]
32+
conventional_commits = true
33+
filter_unconventional = true
34+
split_commits = false
35+
protect_breaking_commits = true
36+
filter_commits = false
37+
tag_pattern = "v[0-9].*"
38+
sort_commits = "newest"
39+
40+
commit_parsers = [
41+
{ message = "^feat", group = "Features" },
42+
{ message = "^fix", group = "Bug Fixes" },
43+
{ message = "^doc", group = "Documentation" },
44+
{ message = "^perf", group = "Performance" },
45+
{ message = "^refactor", group = "Refactor" },
46+
{ message = "^style", group = "Styling" },
47+
{ message = "^test", group = "Testing" },
48+
{ message = "^chore", group = "Miscellaneous" },
49+
{ message = "^ci", group = "CI/CD" },
50+
{ message = "^build", group = "Build" },
51+
]

release-plz.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# release-plz configuration
2+
# https://release-plz.dev/docs/config
3+
4+
[workspace]
5+
# Use git-cliff for changelog generation
6+
changelog_config = "cliff.toml"
7+
8+
[[package]]
9+
name = "morph"
10+
# Publish to crates.io when the release PR is merged
11+
publish = true
12+
# Generate changelog
13+
changelog_update = true
14+
# Run semver checks to catch breaking changes
15+
semver_check = true

0 commit comments

Comments
 (0)