Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
56 changes: 56 additions & 0 deletions .scripts/release_boil.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -euo pipefail

MESSAGE="# Managed by .scripts\/release_boil.sh"

BUMPED_VERSION=$(git-cliff --config rust/boil/cliff.toml --bumped-version)
CLEANED_BUMPED_VERSION=${BUMPED_VERSION#boil-}

RELEASE_BRANCH="chore/boil-release-$CLEANED_BUMPED_VERSION"

# echo "Checking if working directory is clean"
if ! git diff-index --quiet HEAD --; then
echo "Working directory is dirty, aborting" >&2
exit 1
fi

# Switch to main branch after we validated that the working directory is clean
git switch main

# Make sure we have the latest remote changes locally
git pull

echo "Creating and switching to $RELEASE_BRANCH branch"
git switch -c "$RELEASE_BRANCH"

echo "Generating updated changelog for $BUMPED_VERSION"
git-cliff --config rust/boil/cliff.toml --tag "$BUMPED_VERSION" > rust/boil/CHANGELOG.md

echo "Updating the version to $CLEANED_BUMPED_VERSION in the Cargo.toml file"
sed -E -i "s/^version = .* $MESSAGE$/version = \"$CLEANED_BUMPED_VERSION\" $MESSAGE/" rust/boil/Cargo.toml

echo "Committing changes"
# Make sure that there are changes to be committed
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
exit 1
fi

git add rust/boil/CHANGELOG.md rust/boil/Cargo.toml
git commit --message "chore(boil): Release $CLEANED_BUMPED_VERSION" --no-verify --gpg-sign

echo "Pushing changes and raising PR"
CHANGELOG_SUMMARY=$(git-cliff --config rust/boil/cliff.toml --tag "$BUMPED_VERSION" --strip header --unreleased)
PR_BODY="This PR was raised automatically by a release script. It releases $BUMPED_VERSION:\n\n$CHANGELOG_SUMMARY)"

git push --set-upstream origin "$RELEASE_BRANCH"
gh pr create --base main \
--title "chore(boil): Release $CLEANED_BUMPED_VERSION" \
--body "$PR_BODY" \
--assignee "@me" \
--draft

echo "After merging the PR, make sure to run the following commands to finish up the release:"
echo "git switch main && git pull"
echo "git tag -s $BUMPED_VERSION" -m "$BUMPED_VERSION"
echo "git push --follow-tags"
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.

37 changes: 37 additions & 0 deletions rust/boil/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- GENERATED BY GIT-CLIFF, DO NOT EDIT MANUALLY -->

# Changelog

All notable changes to this project will be documented in this file.

## [Unreleased]

### Features

- Support Containerfiles per version ([#1302](https://github.com/stackabletech/docker-images/pull/1302)).

## [[0.1.4](https://github.com/stackabletech/docker-images/compare/boil-0.1.3..boil-0.1.4)] - 2025-09-30

### Bug Fixes

- Revert accidental default registry change from #1281 ([#1288](https://github.com/stackabletech/docker-images/pull/1288)).

## [[0.1.3](https://github.com/stackabletech/docker-images/compare/boil-0.1.2..boil-0.1.3)] - 2025-09-29

### Features

- Add support for port in registry host ([#1281](https://github.com/stackabletech/docker-images/pull/1281)).

## [[0.1.2](https://github.com/stackabletech/docker-images/compare/boil-0.1.1..boil-0.1.2)] - 2025-09-18

### Features

- Add support for Nushell completions ([#1259](https://github.com/stackabletech/docker-images/pull/1259)).

## [0.1.1] - 2025-09-16

### Bug Fixes

- Return error if docker child process fails ([#1252](https://github.com/stackabletech/docker-images/pull/1252)).

<!-- GENERATED BY GIT-CLIFF, DO NOT EDIT MANUALLY -->
2 changes: 1 addition & 1 deletion rust/boil/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "boil"
version = "0.1.0"
version = "0.1.4" # Managed by .scripts/release_boil.sh
edition = "2024"
authors.workspace = true
license.workspace = true
Expand Down
12 changes: 12 additions & 0 deletions rust/boil/RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Release Process

To release a new version of `boil` the following steps need to be done:

1. Make sure the local `main` branch is up-to-date and in a clean state.
2. Run the `.scripts/release_boil.sh` script. This takes care of
- generating the changelog
- updating the `Cargo.toml` version
- raising a PR with the changes
3. Merge the PR.
4. Add the appropriate tag on `main` by running `git tag -s`.
5. Push the tag.
81 changes: 81 additions & 0 deletions rust/boil/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[bump]
# We set this to false, because we currently use a 0.X.X version. Features will thus only bump the
# patch-level version.
features_always_bump_minor = false

# We set this to false, because we currently use a 0.X.X version. Breaking changes will thus only
# bump the minor version.
breaking_always_bump_major = false

initial_tag = "0.1.0"

[git]
# All commits should be parsed as conventional commits.
conventional_commits = true

# All unconventional commits are filtered out and ignored.
filter_unconventional = true

# Commits listed in the changelog are sorted from newest to oldest.
sort_commits = "newest"

# Filter and ignore all commits NOT matched by the commit parsers below.
filter_commits = true

commit_parsers = [
{ message = "^feat\\(boil\\)", group = "<!-- 0 --> Features" },
{ message = "^fix\\(boil\\)", group = "<!-- 1 --> Bug Fixes" },
{ message = "^docs?\\(boil\\)", group = "<!-- 2 --> Documentation" },
{ message = "^(perf|refactor|test)\\(boil\\)", group = "<!-- 3 --> Improvements" },
{ message = "^chore\\(boil\\): Improve", group = "<!-- 3 --> Improvements" },
{ message = "^chore\\(boil\\)", group = "<!-- 4 --> Miscellaneous" },
{ message = "^chore\\(boil\\): Release", skip = true },
]

commit_preprocessors = [
# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/pull/${2}))" },
]

# Only consider the 'boil-' Git tags when generating the changelog
tag_pattern = "boil-[0-9]*.[0-9]*.[0-9]*"

# Ignore the first release tag
skip_tags = "boil-0.1.0"

[changelog]
trim = true

postprocessors = [
# Replace the placeholder `<REPO>` with a URL.
{ pattern = '<REPO>', replace = "https://github.com/stackabletech/docker-images" },
]

header = """<!-- GENERATED BY GIT-CLIFF, DO NOT EDIT MANUALLY -->

# Changelog

All notable changes to this project will be documented in this file.

"""

body = """
{% if version %}\
{% if previous.version %}\
## [[{{ version | trim_start_matches(pat="boil-") }}]\
(<REPO>/compare/{{ previous.version }}..{{ version }})] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [{{ version | trim_start_matches(pat="boil-") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% endif %}\
{% else %}\
## [Unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}**BREAKING:** {% endif %}{{ commit.message | upper_first -}}.
{% endfor %}
{% endfor %}\
"""

footer = "<!-- GENERATED BY GIT-CLIFF, DO NOT EDIT MANUALLY -->"
Loading