@@ -21,6 +21,7 @@ name: Release
2121
2222env :
2323 BRANCH : develop
24+ ORIGIN : awslabs/aws-lambda-powertools-python
2425
2526on :
2627 workflow_dispatch :
@@ -79,24 +80,40 @@ jobs:
7980 if : ${{ !inputs.skip_code_quality }}
8081 run : make pr
8182 - name : Bump package version
83+ id : versioning
8284 run : poetry version "${RELEASE_VERSION}"
8385 - name : Build python package and wheel
8486 if : ${{ !inputs.skip_pypi }}
8587 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 }}
9494 - name : Upload to PyPi prod
9595 if : ${{ !inputs.skip_pypi }}
9696 run : make release-prod
9797 env :
9898 PYPI_USERNAME : __token__
9999 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 "aws-devax-open-source@amazon.com"
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}"
100117
101118 changelog :
102119 needs : release
0 commit comments