From 9c1ce0c82fb415d2b1d0de1079b17c2d3a8bb25a Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 31 Dec 2023 12:59:55 +0100 Subject: [PATCH] Update version naming in GitHub Actions The convention for naming versions in GitHub Actions was modified. Previously, all tags were assigned just a sequential version, even if they were already marked as a release by a tag. Now, if they are tagged and marked as a published release, they use the tag as the version. The change should provide more accurate version information. --- .github/workflows/packages.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 8421bcffd..c960a484e 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -26,10 +26,10 @@ jobs: git branch --remote --contains | grep origin/main - name: Set VERSION variable run: | - if [[ "${{ github.ref }}" == refs/tags/* ]]; then - TAG_NAME=${{ github.ref }} # e.g., refs/tags/preview-740-hotfix-1 + if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && "${{ github.event.action }}" == 'published']]; then + TAG_NAME=${{ github.ref }} # e.g., refs/tags/3.0.0 TAG_NAME=${TAG_NAME#refs/tags/} # remove the refs/tags/ prefix - echo "VERSION=3.0.0-preview-${TAG_NAME}.${{github.run_number}}" >> $GITHUB_ENV + echo "VERSION=${TAG_NAME}" >> $GITHUB_ENV else echo "VERSION=3.0.0-preview.${{github.run_number}}" >> $GITHUB_ENV fi