Skip to content

Commit 32f6893

Browse files
authored
feat: regions (#2)
* feat: add multiple regions - dry run * ci: add finalize back, remove --no-execute-changeset * docs: regions * docs: note disparity between version releases
1 parent 09baef7 commit 32f6893

File tree

2 files changed

+53
-24
lines changed

2 files changed

+53
-24
lines changed

.github/workflows/check-bun-version.yml

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,35 @@ jobs:
3030
runs-on: ubuntu-latest
3131
needs: check
3232
if: needs.check.outputs.latest != needs.check.outputs.current
33+
strategy:
34+
matrix:
35+
region:
36+
- af-south-1
37+
- ap-east-1
38+
- me-south-1
39+
- ap-northeast-1
40+
- ap-northeast-2
41+
- ap-northeast-3
42+
- ap-south-1
43+
- ap-southeast-1
44+
- ap-southeast-2
45+
- ap-southeast-3
46+
- ap-southeast-4
47+
- eu-south-1
48+
- eu-south-2
49+
- eu-central-1
50+
- eu-central-2
51+
- eu-north-1
52+
- eu-west-1
53+
- eu-west-2
54+
- eu-west-3
55+
- sa-east-1
56+
- ca-central-1
57+
- us-east-1
58+
- us-east-2
59+
- us-west-1
60+
- us-west-2
61+
3362
steps:
3463
- uses: actions/checkout@v4
3564

@@ -41,7 +70,7 @@ jobs:
4170
uses: aws-actions/configure-aws-credentials@v4
4271
with:
4372
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
44-
aws-region: us-east-1
73+
aws-region: ${{ matrix.region }}
4574

4675
- name: Build and Deploy layers
4776
run: |
@@ -50,21 +79,16 @@ jobs:
5079
--stack-name bun-runtime \
5180
--no-confirm-changeset \
5281
--resolve-s3 \
53-
--no-execute-changeset ]
5482
--no-fail-on-empty-changeset \
5583
--capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND \
5684
--parameter-overrides "BunVersion=${{ needs.check.outputs.latest }}"
5785
58-
- name: Publish layers
59-
run: |
60-
sam build --template-file publish.yml
61-
sam package \
62-
--output-template-file packaged.yml \
63-
--resolve-s3
64-
65-
sam publish \
66-
--template-file packaged.yaml \
67-
--semantic-version ${{ needs.check.outputs.latest}}
86+
finalize:
87+
runs-on: ubuntu-latest
88+
needs: [check, update]
89+
if: needs.check.outputs.latest != needs.check.outputs.current
90+
steps:
91+
- uses: actions/checkout@v4
6892

6993
- name: Update version file
7094
run: |
@@ -75,8 +99,15 @@ jobs:
7599
git commit -m "chore: update bun version to ${{ needs.check.outputs.latest }}"
76100
git push
77101
102+
103+
- name: Configure AWS credentials
104+
uses: aws-actions/configure-aws-credentials@v4
105+
with:
106+
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
107+
aws-region: us-east-1 # trusted as source of truth for the layer version
108+
78109
- name: Arn Version
79-
id: arn-version
110+
id: arn_version
80111
run: |
81112
STACK_OUTPUTS=$(sam list stack-outputs --stack-name bun-runtime --output json)
82113
@@ -97,9 +128,8 @@ jobs:
97128
body: |
98129
This release updates the Bun runtime to version ${{ needs.check.outputs.latest }}.
99130
100-
### Changes
101-
- Updated Bun to version ${{ needs.check.outputs.latest }}
102-
- Updated AWS Lambda layer for ARM64 (version `${{ steps.arn-version.outputs.arm64_layer_version }}`)
103-
- Updated AWS Lambda layer for x64 (version `${{ steps.arn-version.outputs.x64_layer_version }}`)
131+
### Layer Information
132+
- ARM64: Version `${{ steps.arn_version.outputs.arm64_layer_version }}`
133+
- x64: Version `${{ steps.arn_version.outputs.x64_layer_version }}`
104134
draft: false
105135
prerelease: false

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
This repository provides [Bun](https://bun.sh/) as an AWS Lambda runtime layer. It enables running JavaScript and TypeScript applications on AWS Lambda using Bun.
44

5-
> [!NOTE]
5+
> [!TIP]
66
> This is Bun itself packaged as a Lambda layer, not the special Lambda runtime layer that Bun provides. If you need that layer, you can find instructions over at [oven-sh/bun/packages/bun-lambda](https://github.com/oven-sh/bun/tree/main/packages/bun-lambda)
77
88
## Available Layers
99

1010
Two architecture layers are available:
1111
| Layer Name | Arch | ARN |
1212
|-----------------|-------|-----------------------------------------------------------------|
13-
| BunRuntimeArm64 | ARM64 | `arn:aws:lambda:us-east-1:582637575117:layer:BunRuntimeArm64:{version}` |
14-
| BunRuntimeX64 | X64 | `arn:aws:lambda:us-east-1:582637575117:layer:BunRuntimeX64:{version}` |
13+
| BunRuntimeArm64 | ARM64 | `arn:aws:lambda:{region}:582637575117:layer:BunRuntimeArm64:{version}` |
14+
| BunRuntimeX64 | X64 | `arn:aws:lambda:{region}:582637575117:layer:BunRuntimeX64:{version}` |
1515

1616
## Automatic Updates
1717

@@ -20,11 +20,10 @@ Two architecture layers are available:
2020
This repository automatically checks for new Bun releases on the first day of each month. When a new version is detected:
2121

2222
1. GitHub Actions builds the new layer packages
23-
2. Deploys them to AWS as a new version
24-
25-
## License
23+
2. Deploys them to AWS regions as a new version
2624

27-
MIT
25+
> [!NOTE]
26+
> The version of Bun in the layer may be behind the version in the bun repo and there will not be a corresponding layer version for every version of bun released.
2827
2928
## Author
3029
@sumcoding

0 commit comments

Comments
 (0)