action to auto cut github release (#43)

This commit is contained in:
Doh
2025-01-17 16:17:57 -05:00
committed by GitHub
parent 41ae9df2a0
commit 7ca1744168
3 changed files with 34 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
EXISTS: ${{ steps.check-version.outputs.EXISTS }}
VERSION: ${{ steps.package-version.outputs.VERSION }}
steps:
- name: Checkout code
@@ -66,3 +67,29 @@ jobs:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: rollout restart -n ${{ secrets.KUBE_NAMESPACE }} deploy/${{ secrets.KUBE_DEPLOYMENT }}
create-release:
runs-on: ubuntu-latest
needs: build-and-push
if: needs.build-and-push.outputs.EXISTS == 'false'
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
VERSION: ${{ needs.build-and-push.outputs.VERSION }}
run: |
# Extract release notes from CHANGELOG.md
notes=$(awk -v version="$VERSION" '
$0 ~ "## Version " version {flag=1;next}
$0 ~ "## Version " && flag {exit}
flag' CHANGELOG.md)
gh release create "v$VERSION" \
--repo="$GITHUB_REPOSITORY" \
--title="v$VERSION" \
--notes="$notes"

View File

@@ -1,5 +1,11 @@
# Changelog
## Version 0.1.21
### Added
- auto cut github release for new version
## Version 0.1.20
### Changed

View File

@@ -1,6 +1,6 @@
{
"name": "habittrove",
"version": "0.1.20",
"version": "0.1.21",
"private": true,
"scripts": {
"dev": "next dev --turbopack",