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.
This commit is contained in:
parent
6ba6556cb4
commit
9c1ce0c82f
6
.github/workflows/packages.yml
vendored
6
.github/workflows/packages.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue