File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 with :
2222 node-version : ${{ steps.nvm.outputs.NODE_VERSION }}
2323 - uses : ./
24+ id : publish-release
2425 env :
2526 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
27+ - name : Update shorthand major version tag
28+ run : ./scripts/update-major-version-tag.sh ${{ steps.publish-release.outputs.release-version }}
Original file line number Diff line number Diff line change 66 default : ' release/'
77 required : true
88
9+ outputs :
10+ release-version :
11+ description : ' The version of the release'
12+ value : ${{ steps.get-release-version.outputs.RELEASE_VERSION }}
13+
914runs :
1015 using : ' composite'
1116 steps :
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -x
4+ set -e
5+ set -o pipefail
6+
7+ RELEASE_VERSION=" ${1} "
8+
9+ if [[ -z $RELEASE_VERSION ]]; then
10+ echo " Error: No release version specified."
11+ exit 1
12+ fi
13+
14+ MAJOR_VERSION_TAG=" v${RELEASE_VERSION/ \. */ } "
15+
16+ git config user.name github-actions
17+ git config user.email github-actions@github.com
18+
19+ if git show-ref --tags " $MAJOR_VERSION_TAG " --quiet; then
20+ echo " Tag ${MAJOR_VERSION_TAG} exists, attempting to delete it."
21+ git tag --delete " $MAJOR_VERSION_TAG "
22+ git push --delete origin " $MAJOR_VERSION_TAG "
23+ else
24+ echo " Tag ${MAJOR_VERSION_TAG} does not exist, creating it from scratch."
25+ fi
26+
27+ git tag " $MAJOR_VERSION_TAG " HEAD
28+ git push --tags
29+ echo " Updated shorthand major version tag."
30+
31+ echo " ::set-output name=MAJOR_VERSION_TAG::$MAJOR_VERSION_TAG "
You can’t perform that action at this time.
0 commit comments