From bcddf07a321c82cd064acb1964bdcd76646b8dfa Mon Sep 17 00:00:00 2001 From: Francesco Bruzzesi <42817048+FBruzzesi@users.noreply.github.com> Date: Mon, 14 Oct 2024 09:47:49 +0200 Subject: [PATCH] ci: bump version workflow (#1063) * ci: bump version workflow * Apply suggestions from code review --------- Co-authored-by: Marco Edward Gorelli --- .github/workflows/bump-version.yml | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/bump-version.yml diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml new file mode 100644 index 000000000..b6360cc3d --- /dev/null +++ b/.github/workflows/bump-version.yml @@ -0,0 +1,47 @@ +name: Bump version + +on: + workflow_dispatch: + inputs: + release_type: + description: 'Type of version bump: patch, minor, or major' + required: true + default: 'patch' + type: choice + options: + - patch + - minor + - major + +jobs: + bump-version: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: bump version + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git checkout -b bump-version + python utils/bump_version.py ${{ github.event.inputs.release_type }} + + - name: Create pull request + uses: actions/github-script@v6 + if: github.actor == 'MarcoGorelli' || github.actor == 'FBruzzesi' + with: + script: | + const branch = `bump-version` + github.pulls.create({ + owner: context.repo.owner, + repo: context.repo.repo, + head: branch, + base: 'main', + body: 'Bumping the version to reflect the latest release type.', + }) + \ No newline at end of file