Skip to content

Commit 46e4c6a

Browse files
authored
ci + chore(release): 4.0.1 and auto-create GitHub Release on version bump to main (#210)
* chore(release): 4.0.1 Bump version to 4.0.1 and update changelog for the Alpine Linux 3.17+ (musl) build fix (#204). * ci: auto-create GitHub Release on version bump to main Adds a workflow that detects a change to __version__ in awslambdaric/__init__.py on main, then creates a tag and GitHub Release using notes from RELEASE.CHANGELOG.md. Skips if the release already exists.
1 parent ce38ada commit 46e4c6a

3 files changed

Lines changed: 69 additions & 1 deletion

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: release-on-version-change
2+
3+
# Creates a GitHub Release automatically whenever the package version in
4+
# awslambdaric/__init__.py changes on main. The release notes are taken from
5+
# the matching section of RELEASE.CHANGELOG.md.
6+
on:
7+
push:
8+
branches: [ main ]
9+
paths:
10+
- 'awslambdaric/__init__.py'
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Read version
22+
id: version
23+
run: |
24+
VERSION="$(sed -n 's/^__version__[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' awslambdaric/__init__.py)"
25+
if [ -z "$VERSION" ]; then
26+
echo "Could not determine version from awslambdaric/__init__.py" >&2
27+
exit 1
28+
fi
29+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
30+
echo "Detected version: $VERSION"
31+
32+
- name: Extract changelog notes
33+
env:
34+
VERSION: ${{ steps.version.outputs.version }}
35+
run: |
36+
# Write notes to a file (never interpolated into the shell) so that
37+
# special characters in the changelog (backticks, parentheses, etc.)
38+
# are passed verbatim to gh via --notes-file.
39+
awk -v ver="$VERSION" '
40+
index($0, "`" ver "`") == 1 { capture = 1; next }
41+
capture && /^### / { exit }
42+
capture { print }
43+
' RELEASE.CHANGELOG.md > release-notes.md
44+
# Trim leading blank lines.
45+
sed -i -e '/./,$!d' release-notes.md
46+
if [ ! -s release-notes.md ]; then
47+
echo "No changelog entry found for $VERSION in RELEASE.CHANGELOG.md." >&2
48+
echo "Add a '\`$VERSION\`' section before bumping the version." >&2
49+
exit 1
50+
fi
51+
echo "----- release notes -----"
52+
cat release-notes.md
53+
54+
- name: Create GitHub Release
55+
env:
56+
GH_TOKEN: ${{ github.token }}
57+
VERSION: ${{ steps.version.outputs.version }}
58+
run: |
59+
gh release create "$VERSION" \
60+
--target "$GITHUB_SHA" \
61+
--title "AWS Lambda Runtime Interface Client for Python v$VERSION" \
62+
--notes-file release-notes.md \
63+
--latest

RELEASE.CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### June 25, 2026
2+
`4.0.1`
3+
- Support building on Alpine Linux 3.17+ (musl) without `libexecinfo-dev` ([#204](https://github.com/aws/aws-lambda-python-runtime-interface-client/pull/204))
4+
- Lazy load `multi_concurrent_utils` ([#211](https://github.com/aws/aws-lambda-python-runtime-interface-client/pull/211))
5+
16
### Feb 20, 2026
27
`4.0.0`
38
- Add Lambda Managed Instances (LMI) / Multi-Concurrent Support ([#200](https://github.com/aws/aws-lambda-python-runtime-interface-client/pull/200))

awslambdaric/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
"""
44

5-
__version__ = "4.0.0"
5+
__version__ = "4.0.1"

0 commit comments

Comments
 (0)