Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
53 changes: 53 additions & 0 deletions .github/workflows/release-entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release Changelog

on:
push:
# Automatically create a GitHub Release entry when a tag that looks like a new release is pushed.
# The tag pattern is defined in maven-release-plugin's settings in pom.xml authoritatively. The changelog
# generator - git-cliff - just goes through all relevant tags, regardless of their name.
tags:
- 'v[0-9]+.*'

jobs:
release:
name: Create GitHub Release entry
runs-on: ubuntu-latest
permissions:
# Needed by softprops/action-gh-release to create the GitHub Release entry:
contents: write
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- uses: cachix/install-nix-action@v31

- uses: cachix/cachix-action@v16
with:
name: devenv

- name: Install devenv.sh
run: nix profile install nixpkgs#devenv

- name: Generate change list
shell: devenv shell bash -- -e {0}
run: |
task release:changelog FILE=changes.md

- name: Include the change list in summary
shell: devenv shell bash -- -e {0}
continue-on-error: true
run: |
echo -e "# Generated change list:\n\n----\n\n" >> "$GITHUB_STEP_SUMMARY"
cat changes.md >> "$GITHUB_STEP_SUMMARY"

- name: Create GitHub Release entry
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
# Populate the release entry body with the notes we generated
body_path: changes.md
# A hooman still needs to push the butan
draft: true

# eof
11 changes: 9 additions & 2 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@ tasks:
cmds:
- cmd: mvn -Pupgrades

maintenance:check-reproducibility:
release:changelog:
desc: Creates list of changes since the last release tag
cmds:
- cmd: git-cliff --current --unreleased --output {{ .FILE | default "-" | shellQuote }}

release:check-reproducibility:
# See https://maven.apache.org/guides/mini/guide-reproducible-builds.html
desc: Check if artifacts are reproducible
cmds:
- cmd: mvn artifact:check-buildplan
- cmd: mvn clean install
- cmd: mvn clean verify artifact:compare
- cmd: mvn clean

maintenance:release:
release:create:
desc: Cuts off a new release and deploys artifacts to Sonatype Maven Central
summary: |
This task verifies that appropriate credentials have been entered, cuts off a new
Expand Down Expand Up @@ -81,6 +87,7 @@ tasks:
echo

- cmd: echo "This step primes GnuPG cache so it can be used in non-interactive mode" | gpg --clearsign
- task: release:check-reproducibility
- cmd: mvn --settings={{ .SETTINGS_FILE | shellQuote }} -Prelease -DdryRun=true
- cmd: mvn --settings={{ .SETTINGS_FILE | shellQuote }} -Prelease
- silent: true
Expand Down
92 changes: 92 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# git-cliff ~ configuration file
# https://github.com/orhun/git-cliff
# https://git-cliff.org/docs/configuration

[changelog]
# A Tera template to be rendered for each release in the changelog.
# See https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## [{{ version }}] - {{ 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 | split(pat='\n') | first }}\
{% endfor %}
{% endfor %}
"""
# Remove leading and trailing whitespaces from the changelog's body.
trim = true
# Render body even when there are no releases to process.
render_always = true
# An array of regex based postprocessors to modify the changelog.
postprocessors = [
# Replace the placeholder <REPO> with a URL.
{ pattern = '<REPO>', replace = "https://github.com/tguzik/valueclasses" },
]
# Default output file path
#output = "CHANGELOG.md"

[git]
# Parse commits according to the conventional commits specification.
# See https://www.conventionalcommits.org
conventional_commits = true
# Exclude commits that do not match the conventional commits specification.
filter_unconventional = false
# Require all commits to be conventional.
# Takes precedence over filter_unconventional.
require_conventional = false
# Split commits on newlines, treating each line as an individual commit.
split_commits = false
# An array of regex based parsers to modify commit messages prior to further processing.
commit_preprocessors = [
# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
]
# Prevent commits that are breaking from being excluded by commit parsers.
protect_breaking_commits = true
# An array of regex-based parsers that assign commits to a group.
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
# The regex is applied over the whole message.

# The entries here are processed in order and the first matched regex (the `message` prop) will assign the commit to a group. The
# groups in the output appear in the ascending lexical order of the group names, not the order of these entries. The HTML comment
# in the name of the group still participates in sorting but is omitted from the output - we're using it to manually set the
# order.
# Additional examples: https://git-cliff.org/docs/configuration/git#commit_parsers
commit_parsers = [
{ message = "^feat", group = "<!-- 01 -->Features:" },
{ message = "^fix", group = "<!-- 02 -->Bug Fixes:" },
{ message = "^doc", group = "<!-- 03 -->Documentation:" },
{ message = "^perf", group = "<!-- 04 -->Performance:" },
{ message = "^refactor", group = "<!-- 05 -->Refactor:" },
{ message = "^style", group = "<!-- 06 -->Code Styling:" },
{ message = "^test", group = "<!-- 07 -->Testing:" },
{ message = "^deps|^build\\(deps(-dev)?\\)", group = "<!-- 08 -->Dependencies:" },
{ message = "^build|^ci|^chore", group = "<!-- 09 -->Maintenance:" },
{ message = "^revert", group = "<!-- 10 -->Revert:" },
# { message = "^chore\\(pull\\)", skip = true },
{ message = ".*", group = "<!-- 11 -->Other:" },
]
# Exclude commits that are not matched by any commit parser.
filter_commits = false
# An array of link parsers for extracting external references, and turning them into URLs, using regex.
link_parsers = []
# Include only the tags that belong to the current branch.
use_branch_tags = false
# Order releases topologically instead of chronologically.
topo_order = false
# Order releases topologically instead of chronologically.
topo_order_commits = true
# Order of commits in each group/release within the changelog.
# Allowed values: newest, oldest
sort_commits = "newest"
# Process submodules commits
recurse_submodules = false

# eof
19 changes: 14 additions & 5 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,21 @@
# https://devenv.sh/packages/
# https://search.nixos.org/packages
# Note that the JDK and Maven are already pulled in through the `languages.java` props.
packages = [
packages = with pkgs; [
# Basic utilities
pkgs.curl
pkgs.git
pkgs.go-task
pkgs.gnupg
curl
git
go-task
gnupg

# Maven Daemon
# https://github.com/apache/maven-mvnd
mvnd

# Highly customizable changelog generator
# https://github.com/orhun/git-cliff
# https://git-cliff.org/docs/
git-cliff
];

git-hooks.hooks = {
Expand Down
Loading