22 Commits

Author SHA1 Message Date
93a3eb41fa chore(changelog): update changelog for v0.2.0
All checks were successful
Create Major Version Tag / update-major-tag (release) Successful in 4s
2025-07-02 11:59:16 +00:00
72a343db93 chore(version): update version to 0.2.0
All checks were successful
Auto Changelog & Release / release (push) Successful in 7s
2025-07-02 13:59:09 +02:00
2ca581c65a chore(changelog): update unreleased changelog 2025-07-02 11:56:56 +00:00
fb60cee748 docs(readme): update script reference in usage example
All checks were successful
Auto Changelog & Release / release (push) Successful in 7s
- Replaces the reference to `run.sh` with `bootstrap.sh` in the README
- Reflects the file rename for clarity and consistency
2025-07-02 13:56:48 +02:00
169a1feb2e chore(changelog): update unreleased changelog 2025-07-02 11:56:20 +00:00
fd29805fa1 docs(run.sh): update script documentation and help output
All checks were successful
Auto Changelog & Release / release (push) Successful in 7s
- Improve script documentation for clarity and consistency
- Extend help output to include detailed descriptions of options
2025-07-02 13:56:09 +02:00
b1644de411 docs(script): improve help message layout and readability
- Revamps the script's help message for better clarity and usability
- Consolidates and restructures usage, options, and arguments sections
- Simplifies help text generation using `sed` to avoid redundancy
2025-07-02 13:55:58 +02:00
a59359545d chore(changelog): update unreleased changelog 2025-06-27 21:04:49 +00:00
f1b790d4e3 docs(run.sh): clarify version reference in comments
All checks were successful
Auto Changelog & Release / release (push) Successful in 7s
- Update comments to replace "tag" with "version" for clarity
- Ensures terminology aligns with expected usage
2025-06-27 23:04:38 +02:00
3b3d31b972 chore(changelog): update changelog for v0.1.1
All checks were successful
Create Major Version Tag / update-major-tag (release) Successful in 4s
2025-06-27 20:48:45 +00:00
0a5c2af9a9 chore(version): bump version to 0.1.1
All checks were successful
Auto Changelog & Release / release (push) Successful in 7s
2025-06-27 22:48:36 +02:00
fba5c57fd4 fix(configs): correct environment variable for author email
- Replaces incorrect `AUTHOR_MAIL` with `AUTHOR_EMAIL` in template
- Ensures proper environment variable usage for email retrieval
2025-06-27 22:48:36 +02:00
2367a41cc6 chore(changelog): update unreleased changelog 2025-06-27 20:47:12 +00:00
e689046d01 fix(run): ensure environment variables are passed
All checks were successful
Auto Changelog & Release / release (push) Successful in 6s
- Use `env` to explicitly pass environment variables to the script
- Prevents potential issues with variable scope or inheritance
2025-06-27 22:47:03 +02:00
4ebc8c2daa chore(changelog): update unreleased changelog 2025-06-27 20:44:02 +00:00
c9930e7949 fix(run): ensure environment variables are passed to script
All checks were successful
Auto Changelog & Release / release (push) Successful in 6s
2025-06-27 22:43:55 +02:00
8602477613 chore(changelog): update unreleased changelog 2025-06-27 20:41:54 +00:00
13cdeb80c0 feat(run): add version flag and enforce as required input
All checks were successful
Auto Changelog & Release / release (push) Successful in 8s
- Add a `--version` flag to the script for specifying the version
- Enforce `--version` as a required input with validation
- Update cloning logic to use the `--version` flag for branch selection
2025-06-27 22:41:46 +02:00
6e3f5e3fcb chore(changelog): update unreleased changelog 2025-06-27 20:37:16 +00:00
d9d5363a66 docs(readme): add usage instructions for changelog generator
All checks were successful
Auto Changelog & Release / release (push) Successful in 6s
- Introduce README with instructions for generating Debian-style changelogs
- Provide example command and optional arguments explanation
- Highlight dependencies and output behavior
2025-06-27 22:37:08 +02:00
7f9f72ee71 chore(changelog): update unreleased changelog 2025-06-27 20:35:02 +00:00
eaa9ca9f45 feat(script): add script to generate Debian changelog locally
All checks were successful
Auto Changelog & Release / release (push) Successful in 7s
- Introduces a Bash script to clone a changelog action repository,
  install dependencies, and generate a Debian-style changelog
  in the current directory.
- Supports configurable options for tag, package name, author
  details, output file, and configuration file.
- Enhances local workflows by simplifying changelog generation.
2025-06-27 22:34:33 +02:00
6 changed files with 175 additions and 41 deletions

View File

@@ -2,6 +2,32 @@
All notable changes to this project will be documented in this file.
## [0.2.0](https://git.0xmax42.io/actions/deb-changelog-action/compare/v0.1.1..v0.2.0) - 2025-07-02
### 📚 Documentation
- *(readme)* Update script reference in usage example - ([fb60cee](https://git.0xmax42.io/actions/deb-changelog-action/commit/fb60cee7482173db64f5946d493ac16d5ea6e57d))
- *(run.sh)* Update script documentation and help output - ([fd29805](https://git.0xmax42.io/actions/deb-changelog-action/commit/fd29805fa1c15310f234857362cdfaa0124051e5))
- *(script)* Improve help message layout and readability - ([b1644de](https://git.0xmax42.io/actions/deb-changelog-action/commit/b1644de411d789cb337ac250913a8aad2d53b40d))
- *(run.sh)* Clarify version reference in comments - ([f1b790d](https://git.0xmax42.io/actions/deb-changelog-action/commit/f1b790d4e3ae7d5b2d2300405f6bfdb6898dc8d2))
## [0.1.1](https://git.0xmax42.io/actions/deb-changelog-action/compare/v0.1.0..v0.1.1) - 2025-06-27
### 🚀 Features
- *(run)* Add version flag and enforce as required input - ([13cdeb8](https://git.0xmax42.io/actions/deb-changelog-action/commit/13cdeb80c0b88cbf76185dfd7a3910e472178677))
- *(script)* Add script to generate Debian changelog locally - ([eaa9ca9](https://git.0xmax42.io/actions/deb-changelog-action/commit/eaa9ca9f45abab59590f0b58030a881ddbcb8dd4))
### 🐛 Bug Fixes
- *(configs)* Correct environment variable for author email - ([fba5c57](https://git.0xmax42.io/actions/deb-changelog-action/commit/fba5c57fd4ecbea544f45d2d381542eefba3bcd6))
- *(run)* Ensure environment variables are passed - ([e689046](https://git.0xmax42.io/actions/deb-changelog-action/commit/e689046d01682da4496df446104c4a9eb694c8eb))
- *(run)* Ensure environment variables are passed to script - ([c9930e7](https://git.0xmax42.io/actions/deb-changelog-action/commit/c9930e794915370e7f8e0d81337baa444ef93a85))
### 📚 Documentation
- *(readme)* Add usage instructions for changelog generator - ([d9d5363](https://git.0xmax42.io/actions/deb-changelog-action/commit/d9d5363a666425e9fe97d35dad3eaff3a9f99d03))
## [0.1.0] - 2025-06-27
### 🚀 Features

24
README.md Normal file
View File

@@ -0,0 +1,24 @@
# Debian Changelog Generator
## External Usage
This repository provides a one-liner to generate a Debian-style changelog using `git-cliff`.
## Quick Usage
You can run the generator directly from the URL:
```bash
curl -s https://git.0xmax42.io/actions/deb-changelog-action/raw/branch/main/bootstrap.sh | bash -s -- \
--tag v2.9.1 \
--package_name my-package \
--author_name "John Doe" \
--author_email "john@example.com"
```
Optional arguments:
* `--output_file debian/changelog` (default)
* `--cliff_config path/to/custom.toml`
> ⚠️ This will clone the action to a temporary directory, install `git-cliff`, and write the changelog into your current working directory.

View File

@@ -1 +1 @@
0.1.0
0.2.0

100
bootstrap.sh Executable file
View File

@@ -0,0 +1,100 @@
#!/usr/bin/env bash
# run.sh – local wrapper for the “deb-changelog-action”
#
# Behaviour:
# • Clones https://git.0xmax42.io/actions/deb-changelog-action at the requested version into a temporary directory.
# • Installs git-cliff via the action’s helper script.
# • Generates a Debian-style changelog **in the current working directory** via the action’s generator script.
#
# Usage:
# ./run.sh --version v0 \
# --tag v2.9.1 \
# --package_name mypkg \
# --author_name "Max Mustermann" \
# --author_email max@example.com \
# [--output_file debian/changelog] \
# [--cliff_config path/to/cliff.toml]
#
# Options:
# --version <ver> Action version to clone (required)
# --tag <tag> Git tag used as starting point (required)
# --package_name <name> Debian package name (required)
# --author_name <name> Changelog author name (required)
# --author_email <mail> Changelog author e-mail (required)
# --output_file <file> Changelog path (default: debian/changelog)
# --cliff_config <file> git-cliff config file (default: configs/cliff.debian.toml)
# -h, --help Show this help message
#
# Notes:
# • Paths given for --output_file are interpreted relative to the directory
# where you run this script.
# • If --cliff_config is omitted, the default config shipped with the action
# (configs/cliff.debian.toml) is used.
# • PACKAGE_NAME, AUTHOR_NAME, AUTHOR_EMAIL are exported so the TOML template
# can reference them (e.g. {{ get_env(name="PACKAGE_NAME") }}).
set -euo pipefail
REPO_URL="https://git.0xmax42.io/actions/deb-changelog-action"
# ───────────────────────────────────────────────
VERSION=""
TAG=""
PACKAGE_NAME=""
AUTHOR_NAME=""
AUTHOR_EMAIL=""
OUTPUT_FILE="debian/changelog"
CLIFF_CONFIG=""
# ───────────────────────────────────────────────
show_help() { sed -n '2,34p' "$0"; }
# 1 ─ Parse CLI options ─────────────────────────
while [[ $# -gt 0 ]]; do
case "$1" in
--version) VERSION="$2"; shift 2 ;;
--tag) TAG="$2"; shift 2 ;;
--package_name) PACKAGE_NAME="$2"; shift 2 ;;
--author_name) AUTHOR_NAME="$2"; shift 2 ;;
--author_email) AUTHOR_EMAIL="$2"; shift 2 ;;
--output_file) OUTPUT_FILE="$2"; shift 2 ;;
--cliff_config) CLIFF_CONFIG="$2"; shift 2 ;;
-h|--help) show_help; exit 0 ;;
*) echo "❌ Unknown option: $1"; show_help; exit 1 ;;
esac
done
# 2 ─ Validate mandatory inputs ────────────────
[[ -z "$VERSION" ]] && { echo "❌ --version is required"; exit 1; }
[[ -z "$TAG" ]] && { echo "❌ --tag is required"; exit 1; }
[[ -z "$PACKAGE_NAME" ]] && { echo "❌ --package_name is required"; exit 1; }
[[ -z "$AUTHOR_NAME" ]] && { echo "❌ --author_name is required"; exit 1; }
[[ -z "$AUTHOR_EMAIL" ]] && { echo "❌ --author_email is required"; exit 1; }
# 3 ─ Prepare temporary clone ──────────────────
TMP_DIR=$(mktemp -d)
trap 'rm -rf "$TMP_DIR"' EXIT
echo "📥 Cloning ${REPO_URL}@${VERSION}$TMP_DIR"
git clone --depth 1 --branch "$VERSION" "$REPO_URL" "$TMP_DIR" >/dev/null
# 4 ─ Install git-cliff via helper script ──────
bash "$TMP_DIR/scripts/install-git-cliff.sh"
# 5 ─ Determine config path ────────────────────
if [[ -z "$CLIFF_CONFIG" ]]; then
CLIFF_CONFIG="$TMP_DIR/configs/cliff.debian.toml"
fi
[[ ! -r "$CLIFF_CONFIG" ]] && { echo "❌ Config not found: $CLIFF_CONFIG"; exit 1; }
# 6 ─ Generate changelog in CURRENT dir ────────
echo "📝 Generating changelog (output → $OUTPUT_FILE)"
env \
PACKAGE_NAME="$PACKAGE_NAME" \
AUTHOR_NAME="$AUTHOR_NAME" \
AUTHOR_EMAIL="$AUTHOR_EMAIL" \
bash "$TMP_DIR/scripts/generate-changelog.sh" \
-c "$CLIFF_CONFIG" \
-t "$TAG" \
-o "$OUTPUT_FILE"
echo "✅ Changelog ready: $OUTPUT_FILE"

View File

@@ -8,7 +8,7 @@ body = """\
{% endfor %}\
{% endfor %}
-- {{ get_env(name="AUTHOR_NAME") }} <{{ get_env(name="AUTHOR_MAIL") }}> {% if version %}{{ now() | date(format="%a, %d %b %Y %H:%M:%S %z") }}{% else %}{{ now() | date(format="%a, %d %b %Y %H:%M:%S %z") }}{% endif %}
-- {{ get_env(name="AUTHOR_NAME") }} <{{ get_env(name="AUTHOR_EMAIL") }}> {% if version %}{{ now() | date(format="%a, %d %b %Y %H:%M:%S %z") }}{% else %}{{ now() | date(format="%a, %d %b %Y %H:%M:%S %z") }}{% endif %}
"""

View File

@@ -1,17 +1,27 @@
#!/usr/bin/env bash
# install-git-cliff.sh – fetches the latest or specified git-cliff binary
# Usage (back-compatible):
# sudo ./install-git-cliff.sh # latest version, default arch/dir
# sudo ./install-git-cliff.sh 2.9.1 # specific version
# Extended options:
# sudo ./install-git-cliff.sh -a x86_64-linux-musl [<ver>] # custom arch
# sudo ./install-git-cliff.sh -d /opt/tools [<ver>] # custom install dir
# sudo ./install-git-cliff.sh -n [<ver>] # dry-run (no install)
# sudo ./install-git-cliff.sh -h | --help # help
#
# install-git-cliff.sh – Installs the git-cliff binary
# Usage:
# sudo ./install-git-cliff.sh [options] [<version>]
# Options:
# -a, --arch <triplet> Target architecture (default: ${DEFAULT_ARCH_DISPLAY})
# -d, --dir <path> Installation directory (default: ${INSTALL_DIR_DEFAULT})
# -n, --dry-run Download and verify, but do NOT install
# -h, --help Show this help message
# Arguments:
# <version> git-cliff version to install (default: latest)
# Behaviour:
# • If git-cliff is already in \$PATH and **no version** was requested, the script exits early.
# • If a specific version was requested, the installed version is compared; identical → exit, different → upgrade.
# • If git-cliff is already in PATH and no version was requested the script exits.
# • If a specific version was requested, the installed version is compared and
# only upgraded if it differs.
# Supported architecture triplets (examples):
# aarch64-linux-gnu / musl / apple-darwin / pc-windows-msvc
# i686-linux-gnu / musl / pc-windows-msvc
# x86_64-linux-gnu / musl / apple-darwin / pc-windows-*
set -euo pipefail
REPO="orhun/git-cliff"
@@ -29,33 +39,7 @@ USER_VERSION_SPECIFIED=false
# ───────────────────────────────────────────────
# 0 Help function
show_help() {
cat <<EOF
install-git-cliff.sh – Installs the git-cliff binary
Usage:
sudo ./install-git-cliff.sh [options] [<version>]
Options:
-a, --arch <triplet> Target architecture (default: ${DEFAULT_ARCH_DISPLAY})
-d, --dir <path> Installation directory (default: ${INSTALL_DIR_DEFAULT})
-n, --dry-run Download and verify, but do NOT install
-h, --help Show this help message
Arguments:
<version> git-cliff version to install (default: latest)
Behaviour:
• If git-cliff is already in PATH and no version was requested the script exits.
• If a specific version was requested, the installed version is compared and
only upgraded if it differs.
Supported architecture triplets (examples):
aarch64-linux-gnu / musl / apple-darwin / pc-windows-msvc
i686-linux-gnu / musl / pc-windows-msvc
x86_64-linux-gnu / musl / apple-darwin / pc-windows-*
EOF
}
show_help() { sed -n '2,24p' "$0"; }
# 1 Parse options (keeps old single-arg form)
POSITIONAL=()