@@ -21,6 +21,7 @@ name: Release
21
21
22
22
env :
23
23
BRANCH : develop
24
+ ORIGIN : awslabs/aws-lambda-powertools-python
24
25
25
26
on :
26
27
workflow_dispatch :
@@ -79,24 +80,40 @@ jobs:
79
80
if : ${{ !inputs.skip_code_quality }}
80
81
run : make pr
81
82
- name : Bump package version
83
+ id : versioning
82
84
run : poetry version "${RELEASE_VERSION}"
83
85
- name : Build python package and wheel
84
86
if : ${{ !inputs.skip_pypi }}
85
87
run : poetry build
86
- # NOTE: TestPyPi is undergoing a CDN migration https://status.python.org/#
87
- # re-enable for the next release, when degraded status changes
88
- # - name: Upload to PyPi test
89
- # if: ${{ !inputs.skip_pypi }}
90
- # run: make release-test
91
- # env:
92
- # PYPI_USERNAME: __token__
93
- # PYPI_TEST_TOKEN: ${{ secrets.PYPI_TEST_TOKEN }}
88
+ - name : Upload to PyPi test
89
+ if : ${{ !inputs.skip_pypi }}
90
+ run : make release-test
91
+ env :
92
+ PYPI_USERNAME : __token__
93
+ PYPI_TEST_TOKEN : ${{ secrets.PYPI_TEST_TOKEN }}
94
94
- name : Upload to PyPi prod
95
95
if : ${{ !inputs.skip_pypi }}
96
96
run : make release-prod
97
97
env :
98
98
PYPI_USERNAME : __token__
99
99
PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
100
+ - name : Git client setup and refresh tip
101
+ if : steps.versioning.outcome == 'success'
102
+ run : |
103
+ git config user.name "Release bot"
104
+ git config user.email "[email protected] "
105
+ git config pull.rebase true
106
+ git config remote.origin.url >&- || git remote add origin https://github.com/"${ORIGIN}" # Git Detached mode (release notes) doesn't have origin
107
+ git pull origin "${BRANCH}"
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}"
115
+ git pull origin "${BRANCH}" # prevents concurrent branch update failing push
116
+ git push origin HEAD:refs/heads/"${BRANCH}"
100
117
101
118
changelog :
102
119
needs : release
0 commit comments