Skip to content

Commit

Permalink
chore(release): updated GHA policy and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lmammino committed Oct 30, 2023
1 parent 72024a6 commit de6e554
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/aws/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ Resources:
- "s3:PutObject*"
Resource:
- !Sub "arn:aws:s3:::${SarArtifactsBucket}/*"
- PolicyName: "PublishToSar"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "serverlessrepo:CreateApplication"
- "serverlessrepo:UpdateApplication"
- "serverlessrepo:ListApplicationVersions"
- "serverlessrepo:CreateApplicationVersion"
- "serverlessrepo:GetApplicationPolicy"
- "serverlessrepo:PutApplicationPolicy"
Resource:
- !Sub "arn:aws:serverlessrepo:*:${AWS::AccountId}:applications/oidc-authorizer"

Outputs:
SarArtifactsBucket:
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Release

on:
# TODO: add on release creation
workflow_dispatch: {}
release:
types: [created]

env:
AWS_REGION: eu-west-1
Expand Down Expand Up @@ -60,5 +61,20 @@ jobs:
sam build
sam package --output-template-file .aws-sam/packaged.yml --s3-bucket ${{ secrets.SAR_ARTIFACT_BUCKET }}
- name: Sam publish
- name: Compress bootstrap
working-directory: .aws-sam/build/OidcAuthorizer
run: |
zip -9 bootstrap.zip bootstrap
- name: Upload bootstrap.zip to GitHub release
uses: xresloader/upload-to-github-release@v1
if: github.event.release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ".aws-sam/build/OidcAuthorizer/bootstrap.zip"
tags: true
draft: true

- name: Sam publish to SAR
run: sam publish --template .aws-sam/packaged.yml --region eu-west-1

0 comments on commit de6e554

Please sign in to comment.