52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*' # Startet nur bei Tags wie v1.0.0
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Enable debug output
|
|
run: |
|
|
set -x
|
|
|
|
- name: Checkout source
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Extract repository info
|
|
run: |
|
|
echo "REPO=${GITEA_REPOSITORY#*/}" >> $GITEA_ENV
|
|
echo "OWNER=${GITEA_REPOSITORY%/*}" >> $GITEA_ENV
|
|
|
|
- name: Install git-chglog (no Go needed)
|
|
run: |
|
|
GIT_CHGLOG_VERSION="0.15.1"
|
|
curl -sSL "https://github.com/git-chglog/git-chglog/releases/download/v${GIT_CHGLOG_VERSION}/git-chglog_${GIT_CHGLOG_VERSION}_linux_amd64.tar.gz" -o git-chglog.tar.gz
|
|
tar -xzf git-chglog.tar.gz
|
|
chmod +x git-chglog
|
|
sudo mv git-chglog /usr/local/bin/
|
|
|
|
- name: Show git-chglog version
|
|
run: git-chglog --version
|
|
|
|
- name: Generate CHANGELOG.md for current tag
|
|
run: |
|
|
TAG=$(git describe --tags --abbrev=0)
|
|
echo "Generating changelog for tag: $TAG"
|
|
git-chglog -o CHANGELOG.md "$TAG"
|
|
echo "Changelog generated:"
|
|
cat CHANGELOG.md
|
|
|
|
- name: Create Gitea Release
|
|
uses: https://gitea.com/actions/release-action@main
|
|
with:
|
|
api_key: ${{ secrets.TOKEN }}
|
|
owner: ${{ env.OWNER }}
|
|
repo: ${{ env.REPO }}
|
|
tag: ${{ github.ref_name }}
|
|
body_file: CHANGELOG.md
|