Skip to content

Commit a648c0f

Browse files
Merge pull request #78 from shelfio/feature/polish-readme-resolve-codex-comment-publish-current-release-in-next-midnight
Polish readme, resolve codex comment, version downgrade for next build cycle
2 parents ae07bec + d8c6787 commit a648c0f

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

.github/workflows/update_readme.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Update README
22

3+
# This workflow runs AFTER "Deploy Layers" completes successfully.
4+
# No version checking is needed here because:
5+
# 1. Deploy Layers already checks for new versions and skips if none exist
6+
# 2. Deploy Layers updates .tag_version before this workflow runs
7+
# 3. If this workflow is triggered, README should always be updated
8+
39
on:
410
# push:
511
# branches:
@@ -27,18 +33,36 @@ jobs:
2733
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2834
aws-region: us-east-1
2935

30-
- name: Get Latest Release URL and Tag Version
36+
- name: Get Latest Release Info
3137
run: |
3238
JSON_RESPONSE=$(curl -s https://api.github.com/repos/Sparticuz/chromium/releases/latest)
3339
TAG_VERSION=$(echo $JSON_RESPONSE | grep -Po '"tag_name": "\K[^"]+')
40+
41+
# Get layer file sizes for both architectures and convert to MB
42+
X64_SIZE_BYTES=$(echo $JSON_RESPONSE | grep -Po '"name": "chromium-[^"]+-layer\.x64\.zip"[^}]*"size": \K[0-9]+' | head -1)
43+
ARM64_SIZE_BYTES=$(echo $JSON_RESPONSE | grep -Po '"name": "chromium-[^"]+-layer\.arm64\.zip"[^}]*"size": \K[0-9]+' | head -1)
44+
45+
if [[ -n "$X64_SIZE_BYTES" ]]; then
46+
X64_SIZE_MB=$((X64_SIZE_BYTES / 1024 / 1024))
47+
echo "X64_SIZE_MB=$X64_SIZE_MB" >> $GITHUB_ENV
48+
fi
49+
50+
if [[ -n "$ARM64_SIZE_BYTES" ]]; then
51+
ARM64_SIZE_MB=$((ARM64_SIZE_BYTES / 1024 / 1024))
52+
echo "ARM64_SIZE_MB=$ARM64_SIZE_MB" >> $GITHUB_ENV
53+
fi
54+
3455
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
3556
3657
- name: Update README
3758
run: |
3859
TAG_VERSION=${{ env.TAG_VERSION }}
60+
X64_SIZE_MB=${{ env.X64_SIZE_MB }}
61+
ARM64_SIZE_MB=${{ env.ARM64_SIZE_MB }}
3962
ARN_BASE="arn:aws:lambda:"
4063
ACCOUNT_ID="764866452798"
4164
65+
sed -i -e "s|> .*compressed with Brotli|> ${X64_SIZE_MB} MB (x64) / ${ARM64_SIZE_MB} MB (arm64) Chromium layer for AWS Lambda compressed with Brotli|g" readme.md
4266
sed -i -e "s|Has Chromium v[0-9\.]*|Has Chromium $TAG_VERSION|g" readme.md
4367
4468
for REGION in ${{ env.AWS_REGIONS }}; do

.tag_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v143.0.0
1+
v141.0.0

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Google Chrome for AWS Lambda as a layer
22

3-
> 58 MB Google Chrome to fit inside AWS Lambda Layer compressed with Brotli
3+
> 66 MB (x64) / 64 MB (arm64) Chromium layer for AWS Lambda compressed with Brotli
44
55
[Sparticuz/chromium](https://github.com/Sparticuz/chromium) published as a Lambda Layer.
66

7-
Tested with Node.js 16x/18x/20x. Compatible with x86_64 and arm64 architectures. Has Chromium v143.0.0
7+
Tested with Node.js 16x/18x/20x/22x. Compatible with x86_64 and arm64 architectures. Has Chromium v141.0.0
88

99
## Getting Started
1010

0 commit comments

Comments
 (0)