Skip to content

Commit e391610

Browse files
committed
chore: create a PR to bump version after release
Signed-off-by: heitorlessa <[email protected]>
1 parent 0d53e16 commit e391610

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ jobs:
7979
- name: Run all tests, linting and baselines
8080
if: ${{ !inputs.skip_code_quality }}
8181
run: make pr
82-
- name: Git client setup and refresh tip
83-
run: |
84-
git config user.name "Release bot"
85-
git config user.email "[email protected]"
86-
git config pull.rebase true
87-
git config remote.origin.url >&- || git remote add origin https://github.com/"${ORIGIN}" # Git Detached mode (release notes) doesn't have origin
88-
git pull origin "${BRANCH}"
8982
- name: Bump package version
9083
id: versioning
9184
run: poetry version "${RELEASE_VERSION}"
@@ -105,16 +98,6 @@ jobs:
10598
# and also future-proof for when we switch to protected branch and update via PR
10699
key: ${{ runner.os }}-${{ env.RELEASE_VERSION }}-${{ hashFiles('**/poetry.lock') }}
107100

108-
- name: Update version in trunk
109-
if: steps.versioning.outcome == 'success'
110-
run: |
111-
HAS_CHANGE=$(git status --porcelain)
112-
test -z "${HAS_CHANGE}" && echo "Nothing to update" && exit 0
113-
git add pyproject.toml
114-
git commit -m "bump version to ${RELEASE_VERSION}" --no-verify
115-
git pull origin "${BRANCH}" # prevents concurrent branch update failing push
116-
git push origin HEAD:refs/heads/"${BRANCH}"
117-
118101
release:
119102
needs: build
120103
environment: release
@@ -163,6 +146,28 @@ jobs:
163146
latest_published_version: ${{ needs.build.outputs.RELEASE_VERSION }}
164147
pre_release: ${{ inputs.pre_release }}
165148

149+
bump_version:
150+
needs: [build, release]
151+
permissions:
152+
contents: write
153+
pull-requests: write
154+
runs-on: ubuntu-latest
155+
env:
156+
RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
157+
steps:
158+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
159+
- name: Bump package version
160+
id: versioning
161+
run: poetry version "${RELEASE_VERSION}"
162+
- name: Create PR
163+
id: create-pr
164+
uses: ./.github/actions/create-pr
165+
with:
166+
files: "pyproject.toml"
167+
temp_branch_prefix: "ci-bump"
168+
pull_request_title: "chore(ci): bump version to ${{ env.RELEASE_VERSION }}"
169+
github_token: ${{ secrets.GITHUB_TOKEN }}
170+
166171
post_release:
167172
needs: [build, release, publish_layer]
168173
permissions:

0 commit comments

Comments
 (0)