2323on :
2424 workflow_dispatch :
2525 inputs :
26+ version :
27+ description : " Pre-release version to publish (e.g., 3.24.0a0)"
28+ required : true
29+ type : string
2630 skip_code_quality :
2731 description : " Skip tests, linting, and baseline. Only use if release fail for reasons beyond our control and you need a quick release."
2832 default : false
3337 default : false
3438 type : boolean
3539 required : false
36- schedule :
37- # Note: run daily on weekdays at 8am UTC time
38- - cron : " 0 8 * * 1-5"
3940
4041permissions :
4142 contents : read
@@ -58,38 +59,26 @@ jobs:
5859 artifact_name : ${{ steps.seal_source_code.outputs.artifact_name }}
5960 RELEASE_VERSION : ${{ steps.release_version.outputs.RELEASE_VERSION }}
6061 steps :
61- # NOTE: Different from prod release, we need both poetry and source code available in earlier steps to bump and verify.
62-
63- # We use a pinned version of Poetry to be certain it won't modify source code before we create a hash
64- - name : Install poetry
65- run : |
66- pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
67- pipx inject poetry git+https://github.com/monim67/poetry-bumpversion@348de6f247222e2953d649932426e63492e0a6bf # v0.3.3
68-
6962 - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
7063 with :
7164 ref : ${{ env.RELEASE_COMMIT }}
7265
73- - name : Bump and export release version
66+ - name : Set release version
7467 id : release_version
75- run : |
76- RELEASE_VERSION="$(poetry version prerelease --short | head -n1 | tr -d '\n')"
68+ run : echo "RELEASE_VERSION=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
7769
78- echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "$GITHUB_OUTPUT"
79-
80- - name : Verifies pre-release version semantics
81- # verify pre-release semantics before proceeding to avoid versioning pollution
82- # e.g., 2.40.0a1 and 2.40.0b2 are valid while 2.40.0 is not
83- # NOTE. we do it in a separate step to handle edge cases like
84- # `poetry` CLI uses immutable install, versioning behaviour could change even in a minor version (we had breaking changes before)
85- # a separate step allows us to pinpoint what happened (before/after)
70+ - name : Verify pre-release version semantics
8671 run : |
87- if [[ ! "$RELEASE_VERSION " =~ ^[0-9]+\.[0-9]+\.[0-9]+[a-b].* $ ]]; then
88- echo "Version $VERSION doesn't look like a pre-release version; aborting"
72+ if [[ ! "${{ inputs.version }} " =~ ^[0-9]+\.[0-9]+\.[0-9]+[a-b][0-9]+ $ ]]; then
73+ echo "Version ${{ inputs.version }} doesn't look like a pre-release version (e.g., 3.24.0a0) ; aborting"
8974 exit 1
9075 fi
91- env :
92- RELEASE_VERSION : ${{ steps.release_version.outputs.RELEASE_VERSION}}
76+
77+ - name : Update version in pyproject.toml
78+ run : sed -i 's/^version = ".*"/version = "${{ inputs.version }}"/' pyproject.toml
79+
80+ - name : Update version in version.py
81+ run : sed -i 's/^VERSION = ".*"/VERSION = "${{ inputs.version }}"/' aws_lambda_powertools/shared/version.py
9382
9483 - name : Seal and upload
9584 id : seal_source_code
@@ -126,7 +115,7 @@ jobs:
126115 - name : Install poetry
127116 run : pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
128117 - name : Set up Python
129- uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0 .0
118+ uses : actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1 .0
130119 with :
131120 python-version : " 3.14"
132121 cache : " poetry"
@@ -164,7 +153,7 @@ jobs:
164153 - name : Install poetry
165154 run : pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
166155 - name : Set up Python
167- uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0 .0
156+ uses : actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1 .0
168157 with :
169158 python-version : " 3.14"
170159 cache : " poetry"
0 commit comments