51
51
build :
52
52
runs-on : aws-lambda-powertools_ubuntu-latest_4-core
53
53
permissions :
54
- contents : write
54
+ contents : read
55
55
outputs :
56
56
RELEASE_VERSION : ${{ steps.release_version.outputs.RELEASE_VERSION }}
57
57
env :
79
79
- name : Run all tests, linting and baselines
80
80
if : ${{ !inputs.skip_code_quality }}
81
81
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}"
89
82
- name : Bump package version
90
83
id : versioning
91
84
run : poetry version "${RELEASE_VERSION}"
@@ -105,16 +98,6 @@ jobs:
105
98
# and also future-proof for when we switch to protected branch and update via PR
106
99
key : ${{ runner.os }}-${{ env.RELEASE_VERSION }}-${{ hashFiles('**/poetry.lock') }}
107
100
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
-
118
101
release :
119
102
needs : build
120
103
environment : release
@@ -143,12 +126,6 @@ jobs:
143
126
# with:
144
127
# repository-url: https://test.pypi.org/legacy/
145
128
146
- changelog :
147
- needs : release
148
- permissions :
149
- contents : write
150
- uses : ./.github/workflows/reusable_publish_changelog.yml
151
-
152
129
# NOTE: Watch out for the depth limit of 4 nested workflow_calls.
153
130
# publish_layer -> publish_v2_layer -> reusable_deploy_v2_layer_stack -> reusable_update_v2_layer_arn_docs
154
131
publish_layer :
@@ -163,6 +140,28 @@ jobs:
163
140
latest_published_version : ${{ needs.build.outputs.RELEASE_VERSION }}
164
141
pre_release : ${{ inputs.pre_release }}
165
142
143
+ bump_version :
144
+ needs : [build, release]
145
+ permissions :
146
+ contents : write # create-pr action creates a temporary branch
147
+ pull-requests : write # create-pr action creates a PR using the temporary branch
148
+ runs-on : ubuntu-latest
149
+ env :
150
+ RELEASE_VERSION : ${{ needs.build.outputs.RELEASE_VERSION }}
151
+ steps :
152
+ - uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
153
+ - name : Bump package version
154
+ id : versioning
155
+ run : poetry version "${RELEASE_VERSION}"
156
+ - name : Create PR
157
+ id : create-pr
158
+ uses : ./.github/actions/create-pr
159
+ with :
160
+ files : " pyproject.toml"
161
+ temp_branch_prefix : " ci-bump"
162
+ pull_request_title : " chore(ci): bump version to ${{ env.RELEASE_VERSION }}"
163
+ github_token : ${{ secrets.GITHUB_TOKEN }}
164
+
166
165
post_release :
167
166
needs : [build, release, publish_layer]
168
167
permissions :
0 commit comments