@@ -86,22 +86,28 @@ jobs:
8686 id : release_version
8787 # transform tag format `v<version` to `<version>`
8888 run : |
89- RELEASE_VERSION="${RELEASE_TAG_VERSION:1}"
89+ RELEASE_VERSION="${RELEASE_TAG_VERSION#v}"
90+ VERSION_PART='(0|[1-9][0-9]*)'
91+ if [[ ! "$RELEASE_VERSION" =~ ^${VERSION_PART}\.${VERSION_PART}\.${VERSION_PART}((a|b|rc)${VERSION_PART})?$ ]]; then
92+ echo "Invalid release version: $RELEASE_VERSION"
93+ exit 1
94+ fi
9095 echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "$GITHUB_OUTPUT"
9196
9297 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
9398 with :
9499 ref : ${{ env.RELEASE_COMMIT }}
95100
96- # We use a pinned version of Poetry to be certain it won't modify source code before we create a hash
97- - name : Install poetry
98- run : |
99- pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
100- pipx inject poetry git+https://github.com/monim67/poetry-bumpversion@348de6f247222e2953d649932426e63492e0a6bf # v0.3.3
101-
102101 - name : Bump package version
103102 id : versioning
104- run : poetry version "${RELEASE_VERSION}"
103+ run : |
104+ sed -i "/^\[project\]$/,/^\[/s/^version = \".*\"/version = \"${RELEASE_VERSION}\"/" pyproject.toml
105+ sed -i "s/^VERSION = \".*\"/VERSION = \"${RELEASE_VERSION}\"/" aws_lambda_powertools/shared/version.py
106+ sed -i "/^name = \"aws-lambda-powertools\"$/{n;s/^version = \".*\"/version = \"${RELEASE_VERSION}\"/;}" uv.lock
107+ # Stop before sealing if a field was missing or its format changed.
108+ test "$(sed -n '/^\[project\]$/,/^\[/p' pyproject.toml | grep '^version = ')" = "version = \"${RELEASE_VERSION}\""
109+ test "$(grep '^VERSION = ' aws_lambda_powertools/shared/version.py)" = "VERSION = \"${RELEASE_VERSION}\""
110+ test "$(sed -n '/^name = "aws-lambda-powertools"$/{n;p;}' uv.lock)" = "version = \"${RELEASE_VERSION}\""
105111 env :
106112 RELEASE_VERSION : ${{ steps.release_version.outputs.RELEASE_VERSION}}
107113
@@ -137,13 +143,15 @@ jobs:
137143 - name : Debug cache restore
138144 run : cat pyproject.toml
139145
140- - name : Install poetry
141- run : pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
146+ - name : Set up uv
147+ uses : astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
148+ with :
149+ version : " 0.12.19"
150+ enable-cache : true
142151 - name : Set up Python
143152 uses : actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
144153 with :
145154 python-version : " 3.14"
146- cache : " poetry"
147155 - name : Install dependencies
148156 run : make dev
149157 - name : Run all tests, linting and baselines
@@ -175,16 +183,18 @@ jobs:
175183 integrity_hash : ${{ needs.seal.outputs.integrity_hash }}
176184 artifact_name : ${{ needs.seal.outputs.artifact_name }}
177185
178- - name : Install poetry
179- run : pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
186+ - name : Set up uv
187+ uses : astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
188+ with :
189+ version : " 0.12.19"
190+ enable-cache : true
180191 - name : Set up Python
181192 uses : actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
182193 with :
183194 python-version : " 3.14"
184- cache : " poetry"
185195
186196 - name : Build python package and wheel
187- run : poetry build
197+ run : uv build --no-sources
188198
189199 - name : Seal and upload
190200 id : seal_build
@@ -287,7 +297,7 @@ jobs:
287297
288298 - name : Create Git Tag
289299 run : |
290- git add pyproject.toml aws_lambda_powertools/shared/version.py
300+ git add pyproject.toml uv.lock aws_lambda_powertools/shared/version.py
291301 git commit -m "chore: version bump"
292302 git tag -a v"${RELEASE_VERSION}" -m "release_version: v${RELEASE_VERSION}"
293303 git push origin v"${RELEASE_VERSION}"
@@ -326,7 +336,7 @@ jobs:
326336 id : create-pr
327337 uses : ./.github/actions/create-pr
328338 with :
329- files : " pyproject.toml aws_lambda_powertools/shared/version.py"
339+ files : " pyproject.toml uv.lock aws_lambda_powertools/shared/version.py"
330340 temp_branch_prefix : " ci-bump"
331341 pull_request_title : " chore(ci): bump version to ${{ needs.seal.outputs.RELEASE_VERSION }}"
332342 github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments