Skip to content

Commit

Permalink
ci: add actions to release auto
Browse files Browse the repository at this point in the history
  • Loading branch information
RTAkland committed Dec 30, 2024
1 parent c044322 commit 54744ca
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/create_releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Git
run: |
git fetch --tags
- name: Get the previous tag
id: prev_tag
run: |
previous_tag=$(git tag --sort=-v:refname | grep -B1 ${{ github.ref_name }} | head -n 1)
echo "previous_tag=$previous_tag" >> $GITHUB_ENV
echo "::set-output name=tag::$previous_tag"
- name: Generate release notes
id: release_notes
run: |
if [ -z "${{ env.previous_tag }}" ]; then
changelog=$(git log --oneline)
else
changelog=$(git log "${{ env.previous_tag }}..${{ github.ref_name }}" --oneline)
fi
echo "changelog=$changelog" >> $GITHUB_ENV
echo "::set-output name=notes::$changelog"
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
body: ${{ steps.release_notes.outputs.notes }}
draft: false
prerelease: false

0 comments on commit 54744ca

Please sign in to comment.