- Relocates action files to a flat directory structure - Updates references to the new paths for better organization
47 lines
1.7 KiB
YAML
47 lines
1.7 KiB
YAML
name: "Auto Changelog & Release"
|
|
description: "Detects version bump and, in post-step, writes changelog or publishes release."
|
|
|
|
inputs:
|
|
token: { description: "Gitea/GitHub PAT", default: "" }
|
|
author_name: { description: "Commit author", default: "" }
|
|
author_email: { description: "Commit e-mail", default: "" }
|
|
allow_non_main_release:
|
|
description: "Allow release on branches ≠ main"
|
|
default: "false"
|
|
|
|
outputs:
|
|
release:
|
|
description: "true if VERSION changed"
|
|
value: ${{ steps.detect.outputs.version_changed }}
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- id: detect
|
|
name: Detect version change + queue post work
|
|
uses: ./with-post-step
|
|
with:
|
|
key: AUTOCHANGELOG
|
|
#################### MAIN ####################
|
|
main: |
|
|
${{ github.action_path }}/scripts/detect-version-change.sh
|
|
#################### POST ####################
|
|
post: |
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
# VERSION_CHANGED kommt aus detect-Script via $GITHUB_ENV
|
|
CLIFF_VERSION="$(
|
|
${{ github.action_path }}/scripts/read-cliff-version.sh | tail -n1
|
|
)"
|
|
"${{ github.action_path }}/scripts/install-git-cliff.sh" "$CLIFF_VERSION"
|
|
"${{ github.action_path }}/scripts/setup-git.sh" \
|
|
"${{ inputs.author_name }}" "${{ inputs.author_email }}"
|
|
if [[ "${VERSION_CHANGED:-false}" == "true" ]]; then
|
|
# --- Release-Pfad ---
|
|
RELEASE_PUBLISH_TOKEN='${{ inputs.token }}' \
|
|
"${{ github.action_path }}/scripts/release-from-version.sh"
|
|
else
|
|
# --- Nur Changelog aktualisieren ---
|
|
"${{ github.action_path }}/scripts/generate-unreleased-changelog.sh"
|
|
fi
|