63
63
- name : Unzip artefact
64
64
run : |
65
65
unzip cdk.out.zip
66
- - name : Set SAR name
66
+ - name : Set test SAR name
67
67
run : |
68
68
NAME=${{ env.SAR_NAME }}
69
69
if [[ "${{ inputs.stage }}" == "BETA" ]]; then
@@ -77,13 +77,27 @@ jobs:
77
77
cp README.md LICENSE "./cdk.out/$asset/"
78
78
sam package --template-file template.yml --output-template-file packaged.yml --s3-bucket ${{ secrets.AWS_SAR_S3_BUCKET }}
79
79
sam publish --template packaged.yml --region "$AWS_REGION"
80
+ - name : Publish x86_64 SAR
81
+ if : ${{ inputs.stage == 'PROD' }}
82
+ run : |
83
+ # wait until sar registers the app, otherwise it fails to make it public
84
+ sleep 15
85
+ echo "Make x86_64 SAR app public"
86
+ aws serverlessrepo put-application-policy --application-id arn:aws:serverlessrepo:${{ env.AWS_REGION }}:${{ steps.aws-credentials-sar-role.outputs.aws-account-id }}:applications/${{ env.SAR_NAME }} --statements Principals='*',Actions=Deploy
80
87
- name : Deploy arm64 SAR
81
88
run : |
82
89
asset=$(jq -jc '.Resources[] | select(.Properties.CompatibleArchitectures == ["arm64"]) | .Metadata."aws:asset:path"' cdk.out/LayerV2Stack.template.json)
83
90
sed -e "s|<VERSION>|${{ inputs.package-version }}|g" -e "s/<SAR_APP_NAME>/${{ env.SAR_NAME }}-arm64/g" -e "s|<LAYER_CONTENT_PATH>|./cdk.out/$asset|g" layer/sar/template.txt > template.yml
84
91
cp README.md LICENSE "./cdk.out/$asset/"
85
92
sam package --template-file template.yml --output-template-file packaged.yml --s3-bucket ${{ secrets.AWS_SAR_S3_BUCKET }}
86
93
sam publish --template packaged.yml --region "$AWS_REGION"
94
+ - name : Publish arm64 SAR
95
+ if : ${{ inputs.stage == 'PROD' }}
96
+ run : |
97
+ # wait until sar registers the app, otherwise it fails to make it public
98
+ sleep 15
99
+ echo "Make arm64 SAR app public"
100
+ aws serverlessrepo put-application-policy --application-id arn:aws:serverlessrepo:${{ env.AWS_REGION }}:${{ steps.aws-credentials-sar-role.outputs.aws-account-id }}:applications/${{ env.SAR_NAME }}-arm64 --statements Principals='*',Actions=Deploy
87
101
- name : Deploy BETA canary
88
102
if : ${{ inputs.stage == 'BETA' }}
89
103
run : |
0 commit comments