6464 with :
6565 name : ${{ inputs.artefact-name }}
6666 - name : Unzip artefact
67- run : |
68- unzip cdk.out.zip
69- - name : Set SAR name
67+ run : unzip cdk.out.zip
68+ - name : Configure SAR name
7069 run : |
7170 NAME=${{ env.SAR_NAME }}
7271 if [[ "${{ inputs.stage }}" == "BETA" ]]; then
8382 cp README.md LICENSE "./cdk.out/$asset/"
8483 sam package --template-file template.yml --output-template-file packaged.yml --s3-bucket ${{ secrets.AWS_SAR_S3_BUCKET }}
8584 sam publish --template packaged.yml --region "$AWS_REGION"
86- - name : Publish SAR
87- if : ${{ inputs.stage == 'PROD' }}
88- run : |
89- # wait until sar registers the app, otherwise it fails to make it public
90- sleep 15
91- echo "Make SAR app public"
92- 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
9385 - name : Deploy BETA canary
9486 if : ${{ inputs.stage == 'BETA' }}
9587 run : |
10193
10294 echo "Check if stack does not exist"
10395 stack_exists=$(aws cloudformation list-stacks --query "StackSummaries[?(StackName == '$STACK_NAME' && StackStatus == 'CREATE_COMPLETE')].{StackId:StackId, StackName:StackName, CreationTime:CreationTime, StackStatus:StackStatus}" --output text)
104- echo "$stack_exists"
10596 if [[ -n "$stack_exists" ]] ; then
10697 echo "Found test deployment stack, removing..."
10798 aws cloudformation delete-stack --stack-name "$STACK_NAME"
@@ -124,3 +115,10 @@ jobs:
124115 exit 1
125116 fi
126117 echo "Deployment successful"
118+ - name : Publish SAR
119+ if : ${{ inputs.stage == 'PROD' }}
120+ run : |
121+ # wait until SAR registers the app, otherwise it fails to make it public
122+ sleep 15
123+ echo "Make SAR app public"
124+ 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
0 commit comments