Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bump workflow #2263

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions .github/workflows/bump-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -71,21 +74,13 @@ 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
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: |
Expand All @@ -99,3 +94,18 @@ jobs:
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 }}"