File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -26,24 +26,19 @@ jobs:
2626 echo "BASE_VERSION=${BASE_VERSION%%-DEVBUILD*}" >> $GITHUB_ENV
2727 echo "base_version=${BASE_VERSION%%-DEVBUILD*}" >> $GITHUB_OUTPUT
2828
29- - name : 🔢 Get last dev build number
29+ - name : 🔢 Get dev build number from commit count
3030 id : get-devbuild
3131 run : |
32- VERSION_FILE=".github/devbuild-count.txt"
33- VERSION="${{ steps.version.outputs.base_version }}"
34- mkdir -p .github
35- touch "$VERSION_FILE"
36-
37- CURRENT=$(grep "^$VERSION=" "$VERSION_FILE" | cut -d= -f2)
38- if [ -z "$CURRENT" ]; then
39- CURRENT=1
32+ LAST_TAG=$(git describe --tags --match "${{ env.BASE_VERSION }}*" --abbrev=0 2>/dev/null || echo "")
33+ if [ -n "$LAST_TAG" ]; then
34+ BUILD_NUM=$(git rev-list --count "$LAST_TAG"..HEAD)
4035 else
41- CURRENT =$((CURRENT + 1) )
36+ BUILD_NUM =$(git rev-list --count HEAD )
4237 fi
4338
44- echo "$VERSION=$CURRENT " > "$VERSION_FILE"
45- echo "DEVBUILD=$CURRENT " >> $GITHUB_ENV
46- echo "build_num=$CURRENT" >> $GITHUB_OUTPUT
39+ echo "DEVBUILD=$BUILD_NUM " >> $GITHUB_ENV
40+ echo "build_num=$BUILD_NUM " >> $GITHUB_OUTPUT
41+
4742
4843 - name : 🛠 Build with Maven
4944 run : |
You can’t perform that action at this time.
0 commit comments