Skip to content

Commit

Permalink
add release pipeline (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
singhgss authored Jun 10, 2024
1 parent 7d06c2d commit f87cced
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: AWS CAC Release
on:
push:
tags:
- 'v*'

env:
REGION: ca-central-1

jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.TEST_SERVER_AWS_ROLE_ARN }}
role-session-name: GitHubActions
aws-region: ${{ env.REGION }}

- id: get-release-version
name: Release Version
run: |
releaseName=$(basename ${{ github.ref }})
echo "releasename=$releaseName" >> $GITHUB_OUTPUT
- name: Run Makefile
run: make create-cloudshell-package

- name: Upload file to S3
run: |
aws s3 cp ./cloudshell.zip s3://$S3_BUCKET_NAME/$RELEASE_NAME/
env:
RELEASE_NAME: ${{ steps.get-release-version.outputs.releasename }}
S3_BUCKET_NAME: ${{ secrets.TEST_AWS_CLIENT_STACK_S3_BUCKET }}

- name: Create Release
run: |
if [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref_type }}" == "tag" ]; then
gh release create ${{ github.ref }} --generate-notes --latest "./cloudshell.zip#Azure CAC Solution (zip)"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: ${{ steps.get-release-version.outputs.releasename }}

2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test: test-stack

create-cloudshell-package:
echo Packaging current directory for upload to Cloudshell
zip -r -9 cloudshell_package.zip . -x '*.git*' '*.github*'
zip -r -9 cloudshell.zip . -x '*.git*' '*.github*'

## Generate cloudformation parameter file from config
configure:
Expand Down

0 comments on commit f87cced

Please sign in to comment.