Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
3b3d31b972 | |||
0a5c2af9a9
|
|||
fba5c57fd4
|
|||
2367a41cc6 | |||
e689046d01
|
|||
4ebc8c2daa | |||
c9930e7949
|
|||
8602477613 | |||
13cdeb80c0
|
|||
6e3f5e3fcb | |||
d9d5363a66
|
|||
7f9f72ee71 | |||
eaa9ca9f45
|
17
CHANGELOG.md
17
CHANGELOG.md
@@ -2,6 +2,23 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [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
|
## [0.1.0] - 2025-06-27
|
||||||
|
|
||||||
### 🚀 Features
|
### 🚀 Features
|
||||||
|
24
README.md
Normal file
24
README.md
Normal 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/run.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.
|
@@ -8,7 +8,7 @@ body = """\
|
|||||||
{% endfor %}\
|
{% endfor %}\
|
||||||
{% 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 %}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
92
run.sh
Executable file
92
run.sh
Executable file
@@ -0,0 +1,92 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# run.sh – local wrapper for the “deb-changelog-action”
|
||||||
|
#
|
||||||
|
# This script
|
||||||
|
# 1. clones https://git.0xmax42.io/actions/deb-changelog-action at the
|
||||||
|
# requested tag into a temporary directory,
|
||||||
|
# 2. installs git-cliff using the action’s helper script, and
|
||||||
|
# 3. 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]
|
||||||
|
#
|
||||||
|
# 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,25p' "$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"
|
Reference in New Issue
Block a user