All checks were successful
Build Changelog and Release / release (push) Successful in 7s
45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
name: Build Changelog and Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install git-chglog
|
|
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
|
|
sudo mv git-chglog /usr/local/bin/
|
|
|
|
- name: Generate changelog
|
|
run: |
|
|
git-chglog $(git describe --tags --abbrev=0) > RELEASE_NOTES.md
|
|
|
|
- name: Create Release on Gitea
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.TOKEN }}
|
|
run: |
|
|
TAG=$(git describe --tags)
|
|
REPO=${GITEA_REPOSITORY#*/}
|
|
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
|
|
}"
|
|
|