Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/release-on-version-change.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: release-on-version-change

# Creates a GitHub Release automatically whenever the package version in
# awslambdaric/__init__.py changes on main. The release notes are taken from
# the matching section of RELEASE.CHANGELOG.md.
on:
push:
branches: [ main ]
paths:
- 'awslambdaric/__init__.py'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Read version
id: version
run: |
VERSION="$(grep -Po '__version__\s*=\s*"\K[^"]+' awslambdaric/__init__.py)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use sed/aws instead (-Po is not posix)

if [ -z "$VERSION" ]; then
echo "Could not determine version from awslambdaric/__init__.py" >&2
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Detected version: $VERSION"

- name: Check if release already exists
id: check
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.version.outputs.version }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the release check lives with reading the version and no need for a separate step for it and we could drop the extra check if version exists or not

run: |
if gh release view "$VERSION" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Nit-pick): I'd rename it to (release_exists or something like that)

echo "Release $VERSION already exists; skipping."
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi

- name: Extract changelog notes
if: steps.check.outputs.exists == 'false'
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
# Write notes to a file (never interpolated into the shell) so that
# special characters in the changelog (backticks, parentheses, etc.)
# are passed verbatim to gh via --notes-file.
awk -v ver="$VERSION" '
index($0, "`" ver "`") == 1 { capture = 1; next }
capture && /^### / { exit }
capture { print }
' RELEASE.CHANGELOG.md > release-notes.md
# Trim leading/trailing blank lines.
sed -i -e '/./,$!d' release-notes.md
if [ ! -s release-notes.md ]; then
echo "Release $VERSION" > release-notes.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a version bump always means something changed, having the release body be just the version number isn't useful. I'd prefer the workflow to fail here, forcing the contributor to add a changelog entry before the release is created

fi
echo "----- release notes -----"
cat release-notes.md

- name: Create GitHub Release
if: steps.check.outputs.exists == 'false'
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.version.outputs.version }}
run: |
gh release create "$VERSION" \
--target "$GITHUB_SHA" \
--title "AWS Lambda Runtime Interface Client for Python v$VERSION" \
--notes-file release-notes.md \
--latest
5 changes: 5 additions & 0 deletions RELEASE.CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### June 25, 2026
`4.0.1`
- Support building on Alpine Linux 3.17+ (musl) without `libexecinfo-dev` ([#204](https://github.com/aws/aws-lambda-python-runtime-interface-client/pull/204))
- Lazy load `multi_concurrent_utils` ([#211](https://github.com/aws/aws-lambda-python-runtime-interface-client/pull/211))

### Feb 20, 2026
`4.0.0`
- Add Lambda Managed Instances (LMI) / Multi-Concurrent Support ([#200](https://github.com/aws/aws-lambda-python-runtime-interface-client/pull/200))
Expand Down
2 changes: 1 addition & 1 deletion awslambdaric/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
"""

__version__ = "4.0.0"
__version__ = "4.0.1"
Loading