From 8b2555a82ca363189aa5153d079e5cdd351f5bf1 Mon Sep 17 00:00:00 2001 From: grog Date: Thu, 12 Oct 2023 19:40:33 -0700 Subject: [PATCH] auto increment version --- .github/workflows/build.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43703a35cd..c2afb1369a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,16 +21,28 @@ jobs: run: mvn --batch-mode -Dtest=!**/OpenCV* test -q - name: Package with Maven run: mvn package -DskipTests + + - name: Determine Next Version + id: next_version + run: | + latest_release_tag=$(git describe --tags --abbrev=0) + major_minor="1.1." + current_version="${latest_release_tag#v}" + increment_version=$((current_version + 1)) + next_version="${major_minor}${increment_version}" + echo "::set-output name=next_version::${next_version}" + - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} + tag_name: ${{ steps.next_version.outputs.next_version }} + release_name: Release ${{ steps.next_version.outputs.next_version }} draft: false - prerelease: false + prerelease: false + - name: Upload Release Artifacts uses: actions/upload-release-asset@v1 with: