File tree Expand file tree Collapse file tree 4 files changed +20
-22
lines changed Expand file tree Collapse file tree 4 files changed +20
-22
lines changed Original file line number Diff line number Diff line change 8
8
# see .github/workflows/publish_layer.yml
9
9
10
10
11
- # Get the new version number from the first command-line argument
12
- new_version =$1
13
- if [ -z " $new_version " ]; then
14
- echo " Usage: $0 <new_version >"
11
+ # Get the new layer arn from the first command-line argument
12
+ new_layer_arn =$1
13
+ if [ -z " $new_layer_arn " ]; then
14
+ echo " Usage: $0 <new_layer_arn >"
15
15
exit 1
16
16
fi
17
+ new_version=$( echo $new_layer_arn | sed ' s/.*://' )
17
18
18
19
# Find all files with specified extensions in ./docs and ./examples directories
19
20
# -type f: only find files (not directories)
Original file line number Diff line number Diff line change @@ -17,13 +17,7 @@ name: Make Release
17
17
# 4. Merge the PR created by the `publish_layer` workflow to update the documentation
18
18
# 5. Update draft release notes with the latest changes and publish the release on GitHub
19
19
20
- on :
21
- workflow_dispatch :
22
- inputs :
23
- layer_documentation_version :
24
- description : " Lambda layer version to be updated in our documentation. e.g. if the current layer number is 3, this value must be 4."
25
- type : string
26
- required : true
20
+ on : workflow_dispatch
27
21
28
22
permissions :
29
23
contents : read
105
99
pull-requests : write
106
100
uses : ./.github/workflows/publish_layer.yml
107
101
with :
108
- latest_published_version : ${{ needs.publish-npm.outputs.RELEASE_VERSION }}
109
- layer_documentation_version : ${{ inputs.layer_documentation_version }}
102
+ latest_published_version : ${{ needs.publish-npm.outputs.RELEASE_VERSION }}
Original file line number Diff line number Diff line change 11
11
description : " Latest npm published version to rebuild corresponding layer for, e.g. 1.0.2"
12
12
default : " 1.0.2"
13
13
required : true
14
- layer_documentation_version :
15
- description : " Version to be updated in our documentation. e.g. if the current layer number is 3, this value must be 4."
16
- required : true
17
14
18
15
workflow_call :
19
16
inputs :
26
23
default : false
27
24
type : boolean
28
25
required : false
29
- layer_documentation_version :
30
- description : " Version to be updated in our documentation. e.g. if the current layer number is 3, this value must be 4."
31
- required : true
32
- type : string
33
26
34
27
jobs :
35
28
# Build layer by running cdk synth in layer-publisher directory and uploading cdk.out for deployment
105
98
ref : ${{ github.sha }}
106
99
- name : Replace layer versions in documentation
107
100
run : |
108
- ./.github/scripts/update_layer_arn.sh ${{ inputs.layer_documentation_version }}
101
+ ./.github/scripts/update_layer_arn.sh ${{ needs.deploy-prod.outputs.layer-arn }}
109
102
- name : Stage changes
110
103
run : git add .
111
104
- name : Create PR
Original file line number Diff line number Diff line change 15
15
description : " Latest version that is published"
16
16
required : true
17
17
type : string
18
+ outputs :
19
+ layer-arn :
20
+ description : " The latest deployed Layer ARN"
21
+ value : ${{ jobs.deploy-cdk-stack.outputs.layer-arn }}
18
22
secrets :
19
23
target-account-role :
20
24
required : true
65
69
" il-central-1" ,
66
70
" mx-central-1"
67
71
]
72
+ outputs :
73
+ layer-arn : ${{ steps.store-latest-layer-arn.outputs.layer-arn }}
68
74
steps :
69
75
- name : checkout
70
76
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -89,11 +95,16 @@ jobs:
89
95
- name : Deploy Layer
90
96
run : npm run cdk -w layers -- deploy --app cdk.out --context region=${{ matrix.region }} 'LayerPublisherStack' --require-approval never --verbose --outputs-file cdk-outputs.json
91
97
- name : Store latest Layer ARN
98
+ id : store-latest-layer-arn
92
99
if : ${{ inputs.stage == 'PROD' }}
93
100
run : |
94
101
mkdir cdk-layer-stack
95
102
jq -r -c '.LayerPublisherStack.LatestLayerArn' layers/cdk-outputs.json > cdk-layer-stack/${{ matrix.region }}-layer-version.txt
96
- cat cdk-layer-stack/${{ matrix.region }}-layer-version.txt
103
+ if [ "${{ matrix.region }}" = "us-east-1" ]; then
104
+ echo "layer-arn=$(cat cdk-layer-stack/${{ matrix.region }}-layer-version.txt)" | tee -a "$GITHUB_OUTPUT"
105
+ else
106
+ cat cdk-layer-stack/${{ matrix.region }}-layer-version.txt
107
+ fi
97
108
- name : Save Layer ARN artifact
98
109
if : ${{ inputs.stage == 'PROD' }}
99
110
uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
You can’t perform that action at this time.
0 commit comments