@@ -62,19 +62,30 @@ jobs:
6262 fetch-depth : 1
6363 fetch-tags : false
6464
65- - name : Get Next Version
65+ - name : Get Next Version (Prod)
6666 if : ${{ github.ref_name == 'release' }}
6767 id : semver
6868 uses : ietf-tools/semver-action@v1
6969 with :
7070 token : ${{ github.token }}
7171 branch : release
7272 skipInvalidTags : true
73-
74- - name : Set Next Version Env Var
73+
74+ - name : Get Dev Version
75+ if : ${{ github.ref_name != 'release' }}
76+ id : semverdev
77+ uses : ietf-tools/semver-action@v1
78+ with :
79+ token : ${{ github.token }}
80+ branch : release
81+ skipInvalidTags : true
82+ noVersionBumpBehavior : ' current'
83+ noNewCommitBehavior : ' current'
84+
85+ - name : Set Release Flag
7586 if : ${{ github.ref_name == 'release' }}
7687 run : |
77- echo "NEXT_VERSION=$nextStrict " >> $GITHUB_ENV
88+ echo "IS_RELEASE=true " >> $GITHUB_ENV
7889
7990 - name : Create Draft Release
8091 uses : ncipollo/release-action@v1.14.0
@@ -83,24 +94,24 @@ jobs:
8394 prerelease : true
8495 draft : false
8596 commit : ${{ github.sha }}
86- tag : ${{ env.NEXT_VERSION }}
87- name : ${{ env.NEXT_VERSION }}
97+ tag : ${{ steps.semver.outputs.nextStrict }}
98+ name : ${{ steps.semver.outputs.nextStrict }}
8899 body : ' *pending*'
89100 token : ${{ secrets.GITHUB_TOKEN }}
90101
91102 - name : Set Build Variables
92103 id : buildvars
93104 run : |
94- if [[ $NEXT_VERSION ]]; then
95- echo "Using AUTO SEMVER mode: $NEXT_VERSION "
105+ if [[ $IS_RELEASE ]]; then
106+ echo "Using AUTO SEMVER mode: ${{ steps.semver.outputs.nextStrict }} "
96107 echo "should_deploy=true" >> $GITHUB_OUTPUT
97- echo "pkg_version=$NEXT_VERSION " >> $GITHUB_OUTPUT
98- echo "::notice::Release $NEXT_VERSION created using branch $GITHUB_REF_NAME"
108+ echo "pkg_version=${{ steps.semver.outputs.nextStrict }} " >> $GITHUB_OUTPUT
109+ echo "::notice::Release ${{ steps.semver.outputs.nextStrict }} created using branch $GITHUB_REF_NAME"
99110 else
100- echo "Using TEST mode: 11 .0.0-dev.$GITHUB_RUN_NUMBER"
111+ echo "Using TEST mode: ${{ steps.semverdev.outputs.nextMajorStrict }} .0.0-dev.$GITHUB_RUN_NUMBER"
101112 echo "should_deploy=false" >> $GITHUB_OUTPUT
102- echo "pkg_version=11 .0.0-dev.$GITHUB_RUN_NUMBER" >> $GITHUB_OUTPUT
103- echo "::notice::Non-production build 11 .0.0-dev.$GITHUB_RUN_NUMBER created using branch $GITHUB_REF_NAME"
113+ echo "pkg_version=${{ steps.semverdev.outputs.nextMajorStrict }} .0.0-dev.$GITHUB_RUN_NUMBER" >> $GITHUB_OUTPUT
114+ echo "::notice::Non-production build ${{ steps.semverdev.outputs.nextMajorStrict }} .0.0-dev.$GITHUB_RUN_NUMBER created using branch $GITHUB_REF_NAME"
104115 fi
105116
106117 # -----------------------------------------------------------------
0 commit comments