Skip to content

Create release for v0.7.1 #24

Create release for v0.7.1

Create release for v0.7.1 #24

Workflow file for this run

name: Create Release
run-name: Create release for ${{ github.ref_name }}
on:
push:
tags:
- 'v*'
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
id: changelog
run: |
# Get the previous tag
PREVIOUS_TAG=$(git tag --sort=-v:refname | sed -n '2p')
if [ -z "$PREVIOUS_TAG" ]; then
# If no previous tag, get all commits
CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges)
else
# Get commits since previous tag
CHANGELOG=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges)
fi
# Save changelog to file
echo "$CHANGELOG" > /tmp/changelog.txt
- name: Create Release
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
--notes-file /tmp/changelog.txt