Skip to content

Commit ef1034f

Browse files
committed
chore: release specific version on bump-version
1 parent 859cb4c commit ef1034f

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

.github/workflows/bump-version.yaml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ on:
33
workflow_dispatch:
44
inputs:
55
version:
6-
description: 'The version to bump to'
6+
description: 'The version to release (e.g 1.2.3)'
77
required: true
8-
default: 'minor'
9-
type: choice
10-
options:
11-
- major
12-
- minor
13-
- patch
8+
default: ''
9+
type: string
1410

1511

1612
jobs:
@@ -19,7 +15,7 @@ jobs:
1915
permissions:
2016
contents: write
2117
outputs:
22-
version: ${{ steps.tag_version.outputs.new_version }}
18+
version: ${{ github.event.inputs.version }}
2319
previous_tag: ${{ steps.tag_version.outputs.previous_tag }}
2420
bump_commit_sha: ${{ steps.bumpversion.outputs.commit_hash }}
2521
pr_number: ${{ steps.cpr.outputs.pull-request-number }}
@@ -38,42 +34,41 @@ jobs:
3834
with:
3935
python-version: "3.12"
4036
- name: Create bumpversion
41-
if: steps.tag_version.outputs.new_version
37+
if: github.event.inputs.version
4238
run: |
4339
pip install bump2version
44-
bump2version --new-version ${{ steps.tag_version.outputs.new_version }} setup.cfg tutoraspects/__about__.py .ci/config.yml
40+
bump2version --new-version ${{ github.event.inputs.version }} setup.cfg tutoraspects/__about__.py .ci/config.yml
4541
- name: Update Changelog
46-
if: steps.tag_version.outputs.new_version
42+
if: github.event.inputs.version
4743
uses: stefanzweifel/[email protected]
4844
with:
49-
latest-version: ${{ steps.tag_version.outputs.new_tag }}
45+
latest-version: ${{ github.event.inputs.version }}
5046
release-notes: ${{ steps.tag_version.outputs.changelog }}
5147
- name: Push branch
52-
if: steps.tag_version.outputs.new_version
48+
if: github.event.inputs.version
5349
run: |
54-
branch_name="bot/v${{ steps.tag_version.outputs.new_version }}"
50+
branch_name="bot/v${{ github.event.inputs.version }}"
5551
git fetch --prune origin
5652
if git show-ref --quiet refs/remotes/origin/$branch_name; then
5753
git push --delete origin $branch_name
5854
fi
5955
git checkout -b $branch_name || git checkout $branch_name
6056
git push origin $branch_name
6157
- name: Create Pull Request
62-
if: steps.tag_version.outputs.new_version
6358
id: cpr
6459
uses: peter-evans/create-pull-request@v6
6560
with:
6661
token: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
67-
title: "chore: preparing release ${{ steps.tag_version.outputs.new_version }}"
68-
commit-message: "chore: preparing release ${{ steps.tag_version.outputs.new_version }}"
69-
branch: "bot/v${{steps.tag_version.outputs.new_version}}"
62+
title: "chore: preparing release ${{ github.event.inputs.version }}"
63+
commit-message: "chore: preparing release ${{ github.event.inputs.version }}"
64+
branch: "bot/v${{github.event.inputs.version}}"
7065
base: main
7166
body: |
72-
Automated version bump for release ${{ steps.tag_version.outputs.new_version }}.
67+
Automated version bump for release ${{ github.event.inputs.version }}.
7368
7469
This pull request was automatically generated. It includes the following changes:
7570
76-
- Version: ${{ steps.tag_version.outputs.new_version }}
71+
- Version: ${{ github.event.inputs.version }}
7772
- Previous version: ${{ steps.tag_version.outputs.previous_tag }}
7873
7974
${{ steps.tag_version.outputs.changelog }}

0 commit comments

Comments
 (0)