From b95d444ff104d0b9678a0a127a0dd4257aac4ca7 Mon Sep 17 00:00:00 2001 From: Jan Seidl Date: Mon, 30 Oct 2023 16:03:15 +0100 Subject: [PATCH] different actions for github release --- .github/workflows/_service_release.yaml | 6 ++---- Makefile | 8 +++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/_service_release.yaml b/.github/workflows/_service_release.yaml index 033bb0f..9d6f28a 100644 --- a/.github/workflows/_service_release.yaml +++ b/.github/workflows/_service_release.yaml @@ -34,9 +34,7 @@ jobs: message: '"${{ steps.tag_image.outputs.next_tag }}: PR #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}"' - name: Create Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: tag_name: ${{ steps.tag_image.outputs.next_tag }} - release_name: Release ${{ steps.tag_image.outputs.next_tag }} + generate_release_notes: true diff --git a/Makefile b/Makefile index 20e31b1..35b50a2 100644 --- a/Makefile +++ b/Makefile @@ -12,11 +12,13 @@ new_version_file := /tmp/newtag.txt new_tag: @echo "Pulling current tags." @git pull --ff-only --tags - @LATEST=`git describe --tags --always --abbrev=0 --match "$(SERVICE_NAME)/v*"`; \ + @LATEST=`git describe --tags --always --abbrev=0 --match "$(SERVICE_NAME)/v*" | sed 's/$(SERVICE_NAME)\///'`; \ echo "Latest tag: $$LATEST"; \ NEWPRE="v$$(date +'%Y').$$(date +'%m')"; \ - if [ "$$LATEST" = $$NEWPRE* ]; then \ - new_version="$$LATEST$${LATEST%.*}.$$(( $${LATEST##*.} + 1 ))"; \ + echo "New prefix: $$NEWPRE"; \ + if case $$LATEST in $$NEWPRE*) ;; *) false;; esac ; then \ + echo "Incrementing patch version."; \ + new_version="$${LATEST%.*}.$$(( $${LATEST##*.} + 1 ))"; \ else \ new_version="$$NEWPRE.0"; \ fi; \