Skip to content

Commit 86cbd67

Browse files
chore(cert-tools): Release 0.1.1 (#682)
* chore(cert-tools): Add release instructions * chore(cert-tools): Add changelog * chore(cert-tools): Bump version to 0.1.1 * chore(cert-tools): Add comment to Cargo.toml * chore(cert-tools): Don't match comment in release script, rename variable Co-authored-by: Nick Larsen <nick.larsen@stackable.tech> --------- Co-authored-by: Nick Larsen <nick.larsen@stackable.tech>
1 parent 3221bc4 commit 86cbd67

7 files changed

Lines changed: 204 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cert-tools/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- GENERATED BY GIT-CLIFF, DO NOT EDIT MANUALLY -->
2+
3+
# Changelog
4+
5+
All notable changes to this project will be documented in this file.
6+
7+
## [0.1.1] - 2026-02-23
8+
9+
### Features
10+
11+
- Add typed errors and restructure code ([#678](https://github.com/stackabletech/secret-operator/pull/678)).
12+
13+
<!-- GENERATED BY GIT-CLIFF, DO NOT EDIT MANUALLY -->

rust/cert-tools/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "cert-tools"
33
description = "Merge multiple truststores encoded as PEM or PKCS12 into a JVM compatible format"
4-
version = "0.0.0-dev"
4+
version = "0.1.1" # Managed by .scripts/release_cert-tools.sh
55
authors.workspace = true
66
license.workspace = true
77
edition.workspace = true

rust/cert-tools/RELEASE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Release Process
2+
3+
To release a new version of `cert-tools` the following steps need to be done:
4+
5+
1. Make sure the local `main` branch is up-to-date and in a clean state.
6+
2. Run the `scripts/release_cert-tools.sh` script. This takes care of
7+
- generating the changelog
8+
- updating the `Cargo.toml` version
9+
- raising a PR with the changes
10+
3. Merge the PR.
11+
4. Add the appropriate tag on `main` by running `git tag <TAG> -m <TAG> -s`.
12+
5. Push the tag.

rust/cert-tools/cliff.toml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
[bump]
2+
# We set this to false, because we currently use a 0.X.X version. Features will thus only bump the
3+
# patch-level version.
4+
features_always_bump_minor = false
5+
6+
# We set this to false, because we currently use a 0.X.X version. Breaking changes will thus only
7+
# bump the minor version.
8+
breaking_always_bump_major = false
9+
10+
initial_tag = "cert-tools-0.1.1"
11+
12+
[git]
13+
# All commits should be parsed as conventional commits.
14+
conventional_commits = true
15+
16+
# All unconventional commits are filtered out and ignored.
17+
filter_unconventional = true
18+
19+
# Commits listed in the changelog are sorted from newest to oldest.
20+
sort_commits = "newest"
21+
22+
# Filter and ignore all commits NOT matched by the commit parsers below.
23+
filter_commits = true
24+
25+
commit_parsers = [
26+
{ message = "^chore\\(cert-tools\\): Release", skip = true },
27+
{ message = "^feat\\(cert-tools\\)", group = "<!-- 0 --> Features" },
28+
{ message = "^fix\\(cert-tools\\)", group = "<!-- 1 --> Bug Fixes" },
29+
{ message = "^docs?\\(cert-tools\\)", group = "<!-- 2 --> Documentation" },
30+
{ message = "^(perf|refactor|test)\\(cert-tools\\)", group = "<!-- 3 --> Improvements" },
31+
{ message = "^chore\\(cert-tools\\): Improve", group = "<!-- 3 --> Improvements" },
32+
{ message = "^chore\\(cert-tools\\)", group = "<!-- 4 --> Miscellaneous" },
33+
]
34+
35+
commit_preprocessors = [
36+
# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
37+
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/pull/${2}))" },
38+
]
39+
40+
# Only consider the 'cert-tools-' Git tags when generating the changelog
41+
tag_pattern = "cert-tools-[0-9]*.[0-9]*.[0-9]*"
42+
43+
# Ignore the first release tag
44+
skip_tags = "cert-tools-0.1.0"
45+
46+
[changelog]
47+
trim = true
48+
49+
postprocessors = [
50+
# Replace the placeholder `<REPO>` with a URL.
51+
{ pattern = '<REPO>', replace = "https://github.com/stackabletech/secret-operator" },
52+
]
53+
54+
header = """<!-- GENERATED BY GIT-CLIFF, DO NOT EDIT MANUALLY -->
55+
56+
# Changelog
57+
58+
All notable changes to this project will be documented in this file.
59+
"""
60+
61+
body = """
62+
63+
{% if version %}\
64+
{% if previous.version %}\
65+
## [{{ version | trim_start_matches(pat="cert-tools-") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
66+
67+
[See complete diff](<REPO>/compare/{{ previous.version }}..{{ version }})
68+
{% else %}\
69+
## [{{ version | trim_start_matches(pat="cert-tools-") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
70+
{% endif %}\
71+
{% else %}\
72+
## [Unreleased]
73+
{% endif %}\
74+
75+
{% for group, commits in commits | group_by(attribute="group") %}
76+
### {{ group | striptags | trim | upper_first }}
77+
{% for commit in commits %}
78+
- {% if commit.breaking %}**BREAKING:** {% endif %}\
79+
{{ commit.message | upper_first }}.\
80+
{%- endfor %}
81+
{% endfor -%}
82+
83+
84+
"""
85+
86+
footer = """
87+
88+
<!-- GENERATED BY GIT-CLIFF, DO NOT EDIT MANUALLY -->
89+
"""

scripts/release_cert-tools.sh

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# NOTE: Slashes need to be escaped.
5+
CRATE_VERSION_COMMENT="# Managed by .scripts\/release_cert-tools.sh"
6+
7+
BUMPED_VERSION=$(git-cliff --config rust/cert-tools/cliff.toml --bumped-version)
8+
CLEANED_BUMPED_VERSION=${BUMPED_VERSION#boil-}
9+
10+
RELEASE_BRANCH="chore/cert-tools-release-$CLEANED_BUMPED_VERSION"
11+
12+
echo "Checking if working directory is clean"
13+
if ! git diff-index --quiet HEAD --; then
14+
echo "Working directory is dirty, aborting" >&2
15+
exit 1
16+
fi
17+
18+
# Prompt the user to confirm their Git identity used to create the commit
19+
GIT_EMAIL=$(git config --includes --get user.email)
20+
GIT_USER=$(git config --includes --get user.name)
21+
22+
echo "The following Git user will be used: $GIT_USER <$GIT_EMAIL>"
23+
echo "Is this correct (Y/n)?"
24+
read -r RESPONSE
25+
26+
if [[ "$RESPONSE" == "y" || "$RESPONSE" == "Y" || -z "$RESPONSE" ]]; then
27+
echo "Proceeding with $GIT_USER <$GIT_EMAIL>"
28+
else
29+
>&2 echo "User not accepted. Exiting."
30+
exit 1
31+
fi
32+
33+
# Check dependencies
34+
gh auth status
35+
git-cliff --version
36+
37+
# Switch to main branch after we validated that the working directory is clean
38+
git switch main
39+
40+
# Make sure we have the latest remote changes locally
41+
git pull
42+
43+
echo "Creating and switching to $RELEASE_BRANCH branch"
44+
git switch -c "$RELEASE_BRANCH"
45+
46+
echo "Generating updated changelog for $BUMPED_VERSION"
47+
git-cliff --config rust/cert-tools/cliff.toml --tag "$BUMPED_VERSION" > rust/cert-tools/CHANGELOG.md
48+
49+
echo "Updating the version to $CLEANED_BUMPED_VERSION in the Cargo.toml file"
50+
sed -E -i "s/^version = .*$/version = \"$CLEANED_BUMPED_VERSION\" $CRATE_VERSION_COMMENT/" rust/cert-tools/Cargo.toml
51+
cargo check
52+
53+
echo "Committing changes"
54+
# Make sure that there are changes to be committed
55+
if git diff-index --quiet HEAD --; then
56+
echo "No changes to commit"
57+
exit 1
58+
fi
59+
60+
git add rust/cert-tools/CHANGELOG.md rust/cert-tools/Cargo.*
61+
git commit --message "chore(cert-tools): Release $CLEANED_BUMPED_VERSION" --no-verify --gpg-sign
62+
63+
echo "Do you want to proceed with rasing a PR (y/N)?"
64+
read -r RESPONSE
65+
66+
if [[ "$RESPONSE" == "y" || "$RESPONSE" == "Y" ]]; then
67+
echo "Pushing changes and raising PR"
68+
else
69+
>&2 echo "Not pushing. Exiting."
70+
exit 1
71+
fi
72+
73+
CHANGELOG_SUMMARY=$(git-cliff --config rust/cert-tools/cliff.toml --tag "$BUMPED_VERSION" --strip header --unreleased)
74+
PR_BODY=$(mktemp)
75+
echo -e "This PR was raised automatically by a release script. It releases $BUMPED_VERSION:\n$CHANGELOG_SUMMARY" > "$PR_BODY"
76+
77+
git push --set-upstream origin "$RELEASE_BRANCH"
78+
gh pr create --base main \
79+
--title "chore(cert-tools): Release $CLEANED_BUMPED_VERSION" \
80+
--body-file "$PR_BODY" \
81+
--assignee "@me" \
82+
--draft
83+
84+
echo "After merging the PR, make sure to run the following commands to finish up the release:"
85+
echo "git switch main && git pull"
86+
echo "git tag $BUMPED_VERSION -m $BUMPED_VERSION -s"
87+
echo "git push --follow-tags"

0 commit comments

Comments
 (0)