| .. | ||
| bumpver-post-commit-hook.sh | ||
| bumpver-pre-commit-hook.sh | ||
| README.md | ||
Automation Scripts
This directory contains automation scripts for release management and changelog generation.
Scripts
bumpver-pre-commit-hook.sh
Purpose: Generates a changelog based on merged Pull Requests since the last release.
What it does:
- Queries the Forgejo API for merged pull requests since the last release tag
- Groups pull requests by their labels (first label if multiple labels are present)
- Formats the changes in AsciiDoc format with third-level headers for each label group
- Appends the changelog to
docs/modules/ROOT/pages/web-portal-changelog.adoc - Adds the changelog file to git staging area
- Saves the changelog content for the post-commit hook
Note: Pull requests without labels will be grouped under "Uncategorized".
Requirements:
FORGEJO_TOKENenvironment variable must be set with a valid Forgejo API tokenjqcommand-line JSON processor must be installedcurlmust be installed
bumpver-post-commit-hook.sh
Purpose: Creates a release on Forgejo after a version bump.
What it does:
- Gets the current version from
pyproject.toml - Reads the changelog content generated by the pre-commit hook
- Converts AsciiDoc format to Markdown (headers and links)
- Creates or updates a release on Forgejo with the Markdown-formatted changelog
- Cleans up temporary changelog files
Note: The script automatically converts AsciiDoc syntax to Markdown for Forgejo releases:
=== Header→### Headerlink:url[text]→[text](url)
Requirements:
FORGEJO_TOKENenvironment variable must be set with a valid Forgejo API tokenjqcommand-line JSON processor must be installedcurlmust be installed
Setup
1. Generate a Forgejo API Token
- Log in to Forgejo at https://servala.app.codey.ch
- Go to Settings → Applications → Generate New Token
- Give it a descriptive name (e.g., "bumpver-automation")
- Select the required permissions:
repo(Full control of repositories)
- Copy the generated token
2. Configure the token
Export the token as an environment variable:
export FORGEJO_TOKEN="your-token-here"
For permanent setup, add it to your shell profile (~/.bashrc, ~/.zshrc, etc.):
echo 'export FORGEJO_TOKEN="your-token-here"' >> ~/.bashrc
3. Update pyproject.toml
Update the bumpver configuration in pyproject.toml to use these hooks:
[tool.bumpver]
current_version = "2025.10.27-0"
version_pattern = "YYYY.0M.0D-INC0"
commit_message = "bump version {old_version} -> {new_version}"
tag_message = "{new_version}"
tag_scope = "default"
pre_commit_hook = "hack/bumpver-pre-commit-hook.sh"
post_commit_hook = "hack/bumpver-post-commit-hook.sh"
commit = true
tag = true
push = true
Usage
Once configured, the hooks will run automatically when you bump the version:
# Or let bumpver determine the version based on the pattern
uvx bumpver update
The workflow is:
bumpverupdates version files- Pre-commit hook runs: generates changelog, updates changelog file, stages changes
bumpvercreates commit with version bump and changelogbumpvercreates git tag- Post-commit hook runs: creates Forgejo release
bumpverpushes commit and tags to remote
Manual execution
You can also run the scripts manually:
# Generate changelog (run before committing)
./hack/pre-commit-hook.sh
# Create release (run after committing and tagging)
./hack/post-commit-hook.sh