diff --git a/.scripts/release_boil.sh b/.scripts/release_boil.sh new file mode 100755 index 000000000..e2ef419f2 --- /dev/null +++ b/.scripts/release_boil.sh @@ -0,0 +1,75 @@ +#!/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 + +# Prompt the user to confirm their Git identity used to create the commit +GIT_EMAIL=$(git config --includes --get user.email) +GIT_USER=$(git config --includes --get user.name) + +echo "The following Git user will be used: $GIT_USER <$GIT_EMAIL>" +echo "Is this correct (Y/n)?" +read -r RESPONSE + +if [[ "$RESPONSE" == "y" || "$RESPONSE" == "Y" || -z "$RESPONSE" ]]; then + echo "Proceeding with $GIT_USER <$GIT_EMAIL>" +else + >&2 echo "User not accepted. Exiting." + exit 1 +fi + +# Check dependencies +gh auth status +git-cliff --version + +# 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" diff --git a/Cargo.lock b/Cargo.lock index 3ecf62a5d..eb2975ae8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,7 +111,7 @@ checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "boil" -version = "0.1.0" +version = "0.1.4" dependencies = [ "cap-std", "clap", diff --git a/rust/boil/CHANGELOG.md b/rust/boil/CHANGELOG.md new file mode 100644 index 000000000..3ae953e30 --- /dev/null +++ b/rust/boil/CHANGELOG.md @@ -0,0 +1,43 @@ + + +# 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] - 2025-09-30 + +[See complete diff](https://github.com/stackabletech/docker-images/compare/boil-0.1.3..boil-0.1.4) + +### Bug Fixes + +- Revert accidental default registry change from #1281 ([#1288](https://github.com/stackabletech/docker-images/pull/1288)). + +## [0.1.3] - 2025-09-29 + +[See complete diff](https://github.com/stackabletech/docker-images/compare/boil-0.1.2..boil-0.1.3) + +### Features + +- Add support for port in registry host ([#1281](https://github.com/stackabletech/docker-images/pull/1281)). + +## [0.1.2] - 2025-09-18 + +[See complete diff](https://github.com/stackabletech/docker-images/compare/boil-0.1.1..boil-0.1.2) + +### 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)). + + diff --git a/rust/boil/Cargo.toml b/rust/boil/Cargo.toml index e122c2b97..cefe01910 100644 --- a/rust/boil/Cargo.toml +++ b/rust/boil/Cargo.toml @@ -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 diff --git a/rust/boil/RELEASE.md b/rust/boil/RELEASE.md new file mode 100644 index 000000000..4ad20dfc5 --- /dev/null +++ b/rust/boil/RELEASE.md @@ -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. diff --git a/rust/boil/cliff.toml b/rust/boil/cliff.toml new file mode 100644 index 000000000..20b08a073 --- /dev/null +++ b/rust/boil/cliff.toml @@ -0,0 +1,89 @@ +[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 = " Features" }, + { message = "^fix\\(boil\\)", group = " Bug Fixes" }, + { message = "^docs?\\(boil\\)", group = " Documentation" }, + { message = "^(perf|refactor|test)\\(boil\\)", group = " Improvements" }, + { message = "^chore\\(boil\\): Improve", group = " Improvements" }, + { message = "^chore\\(boil\\)", group = " 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}](/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 `` with a URL. + { pattern = '', replace = "https://github.com/stackabletech/docker-images" }, +] + +header = """ + +# 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-") }}] - {{ timestamp | date(format="%Y-%m-%d") }} + + [See complete diff](/compare/{{ previous.version }}..{{ version }}) + {% 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 = """ + + +"""