Files
kryon/.github/workflows/release.yml
T
2026-11-12 01:29:52 -03:00

41 lines
1.1 KiB
YAML

on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: write
concurrency:
group: kryon-release
cancel-in-progress: false
jobs:
tag:
name: Tag new version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create the release for a new VERSION
env:
GH_TOKEN: ${{ github.token }}
run: |
set -eu
VERSION=$(cat VERSION)
TAG="v$VERSION"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "$TAG already exists, nothing to release"
exit 0
fi
NOTES=$(awk -v v="$VERSION" '$0 ~ "^## \\[" v "\\]" {found=1; next} found && /^## / {exit} found' CHANGELOG.md)
test -n "$NOTES"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a "$TAG" -m "Kryon $VERSION"
git push origin "$TAG"
gh release create "$TAG" --title "Kryon $VERSION" --notes "$NOTES"