Skip to content

Commit

Permalink
Update version naming in GitHub Actions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sfmskywalker committed Dec 31, 2023
1 parent 6ba6556 commit 9c1ce0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c1ce0c

Please sign in to comment.