@@ -10,8 +10,11 @@ permissions:
10
10
id-token : write
11
11
12
12
jobs :
13
- check-and-update :
13
+ check :
14
14
runs-on : ubuntu-latest
15
+ outputs :
16
+ latest : ${{ steps.bun-version.outputs.latest }}
17
+ current : ${{ steps.bun-version.outputs.current }}
15
18
steps :
16
19
- uses : actions/checkout@v4
17
20
@@ -23,20 +26,24 @@ jobs:
23
26
echo "latest=$LATEST_VERSION" >> $GITHUB_OUTPUT
24
27
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
25
28
29
+ update :
30
+ runs-on : ubuntu-latest
31
+ needs : check
32
+ if : needs.check.outputs.latest != needs.check.outputs.current
33
+ steps :
34
+ - uses : actions/checkout@v4
35
+
26
36
- name : Build layers if version changed
27
- if : steps.bun-version.outputs.latest != steps.bun-version.outputs.current
28
37
run : |
29
- BUN_VERSION="${{ steps.bun-version .outputs.latest }}" ./bootstrap
38
+ BUN_VERSION="${{ needs.check .outputs.latest }}" ./bootstrap
30
39
31
40
- name : Configure AWS credentials
32
- if : steps.bun-version.outputs.latest != steps.bun-version.outputs.current
33
41
uses : aws-actions/configure-aws-credentials@v4
34
42
with :
35
43
role-to-assume : ${{ secrets.AWS_ROLE_ARN }}
36
44
aws-region : us-east-1
37
45
38
46
- name : Build and Deploy layers
39
- if : steps.bun-version.outputs.latest != steps.bun-version.outputs.current
40
47
run : |
41
48
sam build
42
49
sam deploy \
46
53
--no-execute-changeset ]
47
54
--no-fail-on-empty-changeset \
48
55
--capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND \
49
- --parameter-overrides "BunVersion=${{ steps.bun-version .outputs.latest }}"
56
+ --parameter-overrides "BunVersion=${{ needs.check .outputs.latest }}"
50
57
51
58
- name : Publish layers
52
- if : steps.bun-version.outputs.latest != steps.bun-version.outputs.current
53
59
run : |
54
60
sam build --template-file publish.yml
55
61
sam package \
@@ -58,29 +64,42 @@ jobs:
58
64
59
65
sam publish \
60
66
--template-file packaged.yaml \
61
- --semantic-version ${{ steps.bun-version .outputs.latest }}
67
+ --semantic-version ${{ needs.check .outputs.latest}}
62
68
63
69
- name : Update version file
64
- if : success() && steps.bun-version.outputs.latest != steps.bun-version.outputs.current
65
70
run : |
66
- echo "${{ steps.bun-version .outputs.latest }}" > .bun-version
71
+ echo "${{ needs.check .outputs.latest }}" > .bun-version
67
72
git config --global user.name 'github-actions[bot]'
68
73
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
69
74
git add .bun-version
70
- git commit -m "chore: update bun version to ${{ steps.bun-version .outputs.latest }}"
75
+ git commit -m "chore: update bun version to ${{ needs.check .outputs.latest }}"
71
76
git push
72
77
78
+ - name : Arn Version
79
+ id : arn-version
80
+ run : |
81
+ STACK_OUTPUTS=$(sam list stack-outputs --stack-name bun-runtime --output json)
82
+
83
+ ARM64_LAYER_ARN=$(echo "$STACK_OUTPUTS" | jq -r '.[] | select(.OutputKey=="BunLayerArm64") | .OutputValue')
84
+ X64_LAYER_ARN=$(echo "$STACK_OUTPUTS" | jq -r '.[] | select(.OutputKey=="BunLayerX64") | .OutputValue')
85
+
86
+ ARM64_LAYER_VERSION=$(echo $ARM64_LAYER_ARN | awk -F: '{print $NF}')
87
+ X64_LAYER_VERSION=$(echo $X64_LAYER_ARN | awk -F: '{print $NF}')
88
+
89
+ echo "arm64_layer_version=$ARM64_LAYER_VERSION" >> $GITHUB_OUTPUT
90
+ echo "x64_layer_version=$X64_LAYER_VERSION" >> $GITHUB_OUTPUT
91
+
73
92
- name : Create GitHub Release
74
- if : success() && steps.bun-version.outputs.latest != steps.bun-version.outputs.current
75
93
uses : softprops/action-gh-release@v1
76
94
with :
77
- tag_name : v${{ steps.bun-version .outputs.latest }}
78
- name : Bun runtime layer with v${{ steps.bun-version .outputs.latest }}
95
+ tag_name : v${{ needs.check .outputs.latest }}
96
+ name : Bun runtime layer with v${{ needs.check .outputs.latest }}
79
97
body : |
80
- This release updates the Bun runtime to version ${{ steps.bun-version .outputs.latest }}.
98
+ This release updates the Bun runtime to version ${{ needs.check .outputs.latest }}.
81
99
82
100
### Changes
83
- - Updated Bun to version ${{ steps.bun-version.outputs.latest }}
84
- - AWS Lambda layers published for x64 and arm64 architectures
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 }})
85
104
draft : false
86
105
prerelease : false
0 commit comments