From 1a0f9b6da41a6c3090612888264a46bcfe5b07ca Mon Sep 17 00:00:00 2001 From: aakrem Date: Thu, 14 Nov 2024 21:12:14 +0100 Subject: [PATCH 1/3] reorder steps --- .github/workflows/bump-versions.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bump-versions.yml b/.github/workflows/bump-versions.yml index 17bb2d8df3..d039e2fad0 100644 --- a/.github/workflows/bump-versions.yml +++ b/.github/workflows/bump-versions.yml @@ -71,14 +71,6 @@ jobs: echo "VERSIONS_MATCH=false" >> $GITHUB_OUTPUT fi - - name: Create and push tag - if: steps.bump_versions.outputs.VERSIONS_MATCH == 'true' - run: | - git config --global user.name "${{ github.actor }}" - git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" - git tag -a "v${{ steps.bump_versions.outputs.NEW_VERSION }}" -m "Version ${{ steps.bump_versions.outputs.NEW_VERSION }}" - git push origin "v${{ steps.bump_versions.outputs.NEW_VERSION }}" - - name: Create Pull Request if: steps.bump_versions.outputs.VERSIONS_MATCH == 'true' uses: peter-evans/create-pull-request@v6 @@ -94,6 +86,14 @@ jobs: - agenta-backend - agenta-cli + - name: Create and push tag + if: steps.bump_versions.outputs.VERSIONS_MATCH == 'true' + run: | + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" + git tag -a "v${{ steps.bump_versions.outputs.NEW_VERSION }}" -m "Version ${{ steps.bump_versions.outputs.NEW_VERSION }}" + git push origin "v${{ steps.bump_versions.outputs.NEW_VERSION }}" + - name: Fail if versions don't match if: steps.bump_versions.outputs.VERSIONS_MATCH != 'true' run: | From 38c6d6bdeb4d093048194219413dff4fe85d3178 Mon Sep 17 00:00:00 2001 From: aakrem Date: Fri, 15 Nov 2024 12:11:37 +0100 Subject: [PATCH 2/3] make branch and tag names different --- .github/workflows/bump-versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-versions.yml b/.github/workflows/bump-versions.yml index d039e2fad0..6a16c37367 100644 --- a/.github/workflows/bump-versions.yml +++ b/.github/workflows/bump-versions.yml @@ -77,7 +77,7 @@ jobs: with: commit-message: v${{ steps.bump_versions.outputs.NEW_VERSION }} author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> - branch: v${{ steps.bump_versions.outputs.NEW_VERSION }} + branch: release/v${{ steps.bump_versions.outputs.NEW_VERSION }} delete-branch: true title: "v${{ steps.bump_versions.outputs.NEW_VERSION }}" body: | From 945568a8dfee58e543be0c7954049ab1dfcd7911 Mon Sep 17 00:00:00 2001 From: aakrem Date: Fri, 15 Nov 2024 12:38:37 +0100 Subject: [PATCH 3/3] split to different workflows --- .github/workflows/bump-versions.yml | 32 +++++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bump-versions.yml b/.github/workflows/bump-versions.yml index 6a16c37367..5ab39ca429 100644 --- a/.github/workflows/bump-versions.yml +++ b/.github/workflows/bump-versions.yml @@ -14,10 +14,13 @@ on: - major jobs: - migrate-db-schema-stage: - name: Bump version - continue-on-error: false + bump-version: + name: Bump version and create PR runs-on: ubuntu-latest + outputs: + new_version: ${{ steps.bump_versions.outputs.NEW_VERSION }} + versions_match: ${{ steps.bump_versions.outputs.VERSIONS_MATCH }} + pr_number: ${{ steps.create-pr.outputs.pull-request-number }} steps: - name: Checkout repository @@ -86,16 +89,23 @@ jobs: - agenta-backend - agenta-cli - - name: Create and push tag - if: steps.bump_versions.outputs.VERSIONS_MATCH == 'true' - run: | - git config --global user.name "${{ github.actor }}" - git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" - git tag -a "v${{ steps.bump_versions.outputs.NEW_VERSION }}" -m "Version ${{ steps.bump_versions.outputs.NEW_VERSION }}" - git push origin "v${{ steps.bump_versions.outputs.NEW_VERSION }}" - - name: Fail if versions don't match if: steps.bump_versions.outputs.VERSIONS_MATCH != 'true' run: | echo "Versions in the three folders do not match. Please check and update manually." exit 1 + + create-tag: + needs: bump-version + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Create and push tag + run: | + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" + git tag -a "v${{ needs.bump-version.outputs.new_version }}" -m "Version ${{ needs.bump-version.outputs.new_version }}" + git push origin "v${{ needs.bump-version.outputs.new_version }}"