Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
6d3d8da80c |
@ -1,44 +1,43 @@
|
|||||||
name: Build Changelog and Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*.*.*'
|
- 'v*' # Reagiere auf Tags wie v1.0.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Go (required for git-chglog)
|
||||||
|
uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: '1.21'
|
||||||
|
|
||||||
- name: Install git-chglog
|
- name: Install git-chglog
|
||||||
run: |
|
run: |
|
||||||
curl -sSL https://github.com/git-chglog/git-chglog/releases/download/v0.15.1/git-chglog_0.15.1_linux_amd64.tar.gz | tar -xz
|
curl -sSL https://github.com/git-chglog/git-chglog/releases/latest/download/git-chglog_linux_amd64 -o git-chglog
|
||||||
|
chmod +x git-chglog
|
||||||
sudo mv git-chglog /usr/local/bin/
|
sudo mv git-chglog /usr/local/bin/
|
||||||
|
|
||||||
- name: Generate changelog
|
- name: Generate CHANGELOG.md for current tag
|
||||||
run: |
|
run: |
|
||||||
git-chglog $(git describe --tags --abbrev=0) > RELEASE_NOTES.md
|
VERSION=$(git describe --tags --abbrev=0)
|
||||||
|
git-chglog -o CHANGELOG.md "$VERSION"
|
||||||
|
|
||||||
- name: Create Release on Gitea
|
- name: Extract repository info
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
TAG=$(git describe --tags)
|
echo "REPO=${GITEA_REPOSITORY#*/}" >> $GITEA_ENV
|
||||||
REPO=${GITEA_REPOSITORY#*/}
|
echo "OWNER=${GITEA_REPOSITORY%/*}" >> $GITEA_ENV
|
||||||
OWNER=${GITEA_REPOSITORY%/*}
|
|
||||||
BODY=$(cat RELEASE_NOTES.md | jq -Rs .)
|
|
||||||
|
|
||||||
curl -X POST "https://dev.ksite.de/api/v1/repos/ralf.kirchner/demo/releases" \
|
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{
|
|
||||||
\"tag_name\": \"$TAG\",
|
|
||||||
\"name\": \"$TAG\",
|
|
||||||
\"body\": $BODY,
|
|
||||||
\"draft\": false,
|
|
||||||
\"prerelease\": false
|
|
||||||
}"
|
|
||||||
|
|
||||||
|
- 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
|
||||||
|
Reference in New Issue
Block a user