From 28cb1df73c6d2efa125ecef0db544bec488c7b67 Mon Sep 17 00:00:00 2001 From: Michael Rapp Date: Wed, 24 Apr 2024 00:51:48 +0200 Subject: [PATCH] Fix release workflow. --- .github/workflows/release.yml | 41 ++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84ccf8cc7d..5c727999c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,29 +23,50 @@ jobs: - name: Checkout release branch run: | git checkout ${{ github.event.release.target_commitish }} - - name: Update major version + - name: Reset development version if: ${{ github.event.release.target_commitish == 'main' }} run: | ./build reset_development_version git add VERSION.dev && git commit -m "[Bot] Update development version to $(cat VERSION.dev)." && git push origin main - ./build increment_major_version - git add VERSION - git commit -m "[Bot] Update version to $(cat VERSION)." - git push origin main - name: Merge into feature branch if: ${{ github.event.release.target_commitish == 'main' }} run: | git checkout -b feature origin/feature git merge origin/main --strategy-option theirs -m "[Bot] Merge branch \"main\" into \"feature\"." - ./build increment_minor_version - git add VERSION - git commit -m "[Bot] Update version to $(cat VERSION)." git push origin feature - name: Merge into bugfix branch if: ${{ github.event.release.target_commitish == 'main' }} || ${{ github.event.release.target_commitish == 'feature' }} run: | git checkout -b bugfix origin/bugfix - git merge origin/feature --strategy-option theirs -m "[Bot] Merge branch \"main\" into \"bugfix\"." + git merge origin/feature --strategy-option theirs -m "[Bot] Merge branch \"feature\" into \"bugfix\"." + git push origin bugfix + - name: Update major version + if: ${{ github.event.release.target_commitish == 'main' }} + run: | + git checkout main + ./build increment_major_version + git add VERSION + git commit -m "[Bot] Update version to $(cat VERSION)." + git push origin main + git checkout feature + ./build increment_minor_version + git add VERSION + git commit -m "[Bot] Update version to $(cat VERSION)." + git push origin feature + git checkout bugfix + ./build increment_patch_version + git add VERSION + git commit -m "[Bot] Update version to $(cat VERSION)." + git push origin bugfix + - name: Update minor version + if: ${{ github.event.release.target_commitish == 'feature' }} + run: | + git checkout feature + ./build increment_minor_version + git add VERSION + git commit -m "[Bot] Update version to $(cat VERSION)." + git push origin feature + git checkout bugfix ./build increment_patch_version git add VERSION git commit -m "[Bot] Update version to $(cat VERSION)." @@ -53,7 +74,7 @@ jobs: - name: Update patch version if: ${{ github.event.release.target_commitish == 'bugfix' }} run: | - git checkout -b bugfix origin/bugfix + git checkout bugfix ./build increment_patch_version git add VERSION git commit -m "[Bot] Update version to $(cat VERSION)."