mirror of
https://github.com/ManInDark/HabitTrove.git
synced 2026-01-20 22:24:28 +01:00
action to auto cut github release (#43)
This commit is contained in:
27
.github/workflows/docker-publish.yml
vendored
27
.github/workflows/docker-publish.yml
vendored
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user