chore(release): prepare 1.0.0 release
Some checks failed
Publish Docker Images / coverage-and-sonar (push) Successful in 24m35s
Release / checks (push) Failing after 11m47s
Release / release (push) Has been skipped

This commit is contained in:
2026-03-23 13:36:45 +01:00
parent 7a6f513cb1
commit e5879126cf
6 changed files with 168 additions and 75 deletions

98
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,98 @@
name: Release
on:
push:
branches:
- main
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run Checks
run: nix develop --no-pure-eval --accept-flake-config --command just check-all
release:
needs: checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CI_TOKEN }}
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Check for releasable commits
id: releasable
run: |
COUNT=$(git-cliff --unreleased | tail -n +3 | wc -l)
echo "count=$COUNT" >> $GITHUB_OUTPUT
- name: Determine next version
if: steps.releasable.outputs.count > 0
id: next_version
run: echo "version=$(git-cliff --bumped-version)" >> $GITHUB_OUTPUT
- name: Update changelog
if: steps.releasable.outputs.count > 0
run: git-cliff --bump -o CHANGELOG.md
- name: Create release commit
if: steps.releasable.outputs.count > 0
run: |
VERSION=${{ steps.next_version.outputs.version }}
nix develop --no-pure-eval --accept-flake-config --command cargo set-version "$VERSION"
git config user.name "CI Bot"
git config user.email "ci@phundrak.com"
git add Cargo.toml Cargo.lock CHANGELOG.md
git commit -m "chore(release): release $VERSION [skip ci]"
git push origin main
- name: Create version tag
if: steps.releasable.outputs.count > 0
run: |
VERSION=${{ steps.next_version.outputs.version }}
git tag "$VERSION"
git push origin "$VERSION"
- name: Build Linux release binaries
if: steps.releasable.outputs.count > 0
run: nix build
- name: Build Windows release binaries
if: steps.releasable.outputs.count > 0
run: nix build .#windows
- name: Publish on crates.io
if: steps.releasable.outputs.count > 0
run: nix develop --no-pure-eval --accept-flake-config --command cargo publish
env:
CARGO_REGISTRIES_CRATES_IO_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Rebase develop onto main
if: steps.releasable.outputs.count > 0
run: |
git fetch origin
git checkout develop
git rebase origin/main
- name: Bump to next dev version
if: steps.releasable.outputs.count > 0
run: |
VERSION=${{ steps.next_version.outputs.version }}
# Bump patch and append -dev
NEXT_DEV=$(echo $VERSION | awk -F. '{print $1"."$2"."$3+1}')"-dev"
nix develop --no-pure-eval --accept-flake-config --command cargo set-version "$NEXT_DEV"
git add Cargo.toml Cargo.lock
git commit -m "chore(release): bump version to $NEXT_DEV [skip ci]"
git push origin develop

2
Cargo.lock generated
View File

@@ -1650,7 +1650,7 @@ dependencies = [
[[package]]
name = "jj-cz"
version = "0.1.0"
version = "1.0.0-dev"
dependencies = [
"assert_cmd",
"assert_fs",

View File

@@ -1,8 +1,8 @@
[package]
name = "jj-cz"
version = "0.1.0"
version = "1.0.0-dev"
edition = "2024"
publish = false
publish = true
authors = ["Lucien Cartier-Tilet <lucien@phundrak.com>"]
license = "MIT OR GPL-3.0-or-later"
homepage = "https://labs.phundrak.com/phundrak/jj-cz"
@@ -47,3 +47,66 @@ lto = true
codegen-units = 1
panic = "abort"
strip = true
[package.metadata.git-cliff.changelog]
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits %}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}
"""
trim = true
render_always = true
postprocessors = [
{ pattern = '<REPO>', replace = "https://labs.phundrak.com/phundrak/jj-cz" },
]
[package.metadata.git-cliff.bump]
features_always_bump_minor = true
breaking_always_bump_major = true
initial_tag = "0.1.0"
[package.metadata.git-cliff.git]
conventional_commits = true
filter_unconventional = true
require_conventional = false
split_commits = false
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
{ pattern = '.*', replace_command = 'typos --write-changes -' },
]
protect_breaking_commits = false
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->Features" },
{ message = "^fix", group = "<!-- 1 -->Bug Fixes" },
{ message = "^doc", group = "<!-- 3 -->Documentation" },
{ message = "^perf", group = "<!-- 4 -->Performance" },
{ message = "^refactor", group = "<!-- 2 -->Refactor" },
{ message = "^style", group = "<!-- 5 -->Styling" },
{ message = "^test", group = "<!-- 6 -->Testing" },
{ message = "^chore\\(release\\):", skip = true },
{ message = "^chore\\(deps.*\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^chore|^ci", group = "<!-- 7 -->Miscellaneous Tasks" },
{ body = ".*security", group = "<!-- 8 -->Security" },
{ message = "^revert", group = "<!-- 9 -->Revert" },
{ message = ".*", group = "<!-- 10 -->Other" },
]
filter_commits = false
fail_on_unmatched_commit = false
link_parsers = []
use_branch_tags = false
topo_order = false
topo_order_commits = true
sort_commits = "oldest"
recurse_submodules = false

View File

@@ -1,71 +0,0 @@
# configuration file for git-cliff
# see https://github.com/orhun/git-cliff#configuration-file
[changelog]
# changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
# https://tera.netlify.app/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""
[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^doc", group = "Documentation"},
{ message = "^perf", group = "Performance"},
{ message = "^refactor", group = "Refactor"},
{ message = "^style", group = "Styling"},
{ message = "^test", group = "Testing"},
{ message = "^chore\\(release\\): prepare for", skip = true},
{ message = "^chore", group = "Miscellaneous Tasks"},
{ body = ".*security", group = "Security"},
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# glob pattern for matching git tags
tag_pattern = "v[0-9]*"
# regex for skipping tags
skip_tags = "v0.1.0-beta.1"
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
# limit the number of commits included in the changelog.
# limit_commits = 42

View File

@@ -19,9 +19,12 @@ inputs.devenv.lib.mkShell {
})
bacon
cargo-deny
cargo-edit
cargo-nextest
cargo-tarpaulin
git-cliff
just
typos
];
}
];

View File

@@ -81,7 +81,7 @@ impl ConventionalCommit {
+ self.description.len()
}
/// Format the complete commit messsage
/// Format the complete commit message
///
/// Returns `type(scope): description` if scope is non-empty, or
/// `type: description` if scope is empty