Skip to content

Commit

Permalink
build: fix tag not found on release
Browse files Browse the repository at this point in the history
  • Loading branch information
chillleader committed Nov 13, 2023
1 parent 714acd2 commit 8c8eb9a
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/RELEASE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,30 @@ jobs:
ref: ${{ github.event.release.target_commitish }}
fetch-depth: 0

- name: Check if new version implies pre-release
id: check_prerelease
run: |
if [[ ${{github.event.release.prerelease}} == "true" ]]; then
PRE_RELEASE=true
elif [[ ${{ github.event.release.tag_name }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
PRE_RELEASE=false
else
PRE_RELEASE=true
fi
echo "isPreRelease=${PRE_RELEASE}" >> $GITHUB_OUTPUT
- name: Get previous tag for changelog
id: get_previous_tag
run: |
git pull --tags
if [[ ${{steps.check_prerelease.outputs.isPreRelease}} == "true" ]]; then
TAG_NAME=$(git --no-pager tag --sort=-creatordate | head -2 | tail -1)
else
TAG_NAME=$(git --no-pager tag --sort=-creatordate | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -2 | tail -1)
fi
echo "previousTag: $TAG_NAME"
echo "previousTag=${TAG_NAME}" >> $GITHUB_OUTPUT
- name: Import Secrets
id: secrets
uses: hashicorp/[email protected]
Expand Down Expand Up @@ -83,29 +107,6 @@ jobs:
- name: Install element templates CLI
run: npm install --global element-templates-cli

- name: Check if new version implies pre-release
id: check_prerelease
run: |
if [[ ${{github.event.release.prerelease}} == "true" ]]; then
PRE_RELEASE=true
elif [[ ${{ github.event.release.tag_name }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
PRE_RELEASE=false
else
PRE_RELEASE=true
fi
echo "isPreRelease=${PRE_RELEASE}" >> $GITHUB_OUTPUT
- name: Get previous tag for changelog
id: get_previous_tag
run: |
if [[ ${{steps.check_prerelease.outputs.isPreRelease}} == "true" ]]; then
TAG_NAME=$(git --no-pager tag --sort=-creatordate | head -2 | tail -1)
else
TAG_NAME=$(git --no-pager tag --sort=-creatordate | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -2 | tail -1)
fi
echo "previousTag: $TAG_NAME"
echo "previousTag=${TAG_NAME}" >> $GITHUB_OUTPUT
# Maven build & version bump

- name: Set Connectors release version
Expand Down

0 comments on commit 8c8eb9a

Please sign in to comment.