This repository has been archived by the owner on Feb 8, 2023. It is now read-only.
forked from aws-solutions/serverless-image-handler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from fishbrain/create-release-workflow
Add release action
- Loading branch information
Showing
5 changed files
with
66 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Create release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
DIST_OUTPUT_BUCKET: fishbrain-lambda-deploy | ||
REGION: eu-west-1 | ||
SOLUTION_NAME: serverless-image-handler | ||
VERSION: v5.2.1-meta | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install cdk | ||
run: npm install -g aws-cdk | ||
- name: Build | ||
run: | | ||
cd deployment | ||
chmod +x ./build-s3-dist.sh | ||
./build-s3-dist.sh ${{ env.DIST_OUTPUT_BUCKET }} ${{ env.SOLUTION_NAME }} ${{ env.VERSION }} | ||
- name: Archive global assets | ||
uses: papeloto/action-zip@v1 | ||
with: | ||
files: deployment/global-s3-assets | ||
dest: global-s3-assets.zip | ||
- name: Archive regional assets | ||
uses: papeloto/action-zip@v1 | ||
with: | ||
files: deployment/regional-s3-assets | ||
dest: regional-s3-assets.zip | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
regional-s3-assets.zip | ||
global-s3-assets.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { expect as expectCDK, matchTemplate, MatchStyle } from '@aws-cdk/assert'; | ||
import {expect as expectCDK, MatchStyle, matchTemplate} from '@aws-cdk/assert'; | ||
import * as cdk from '@aws-cdk/core'; | ||
import * as Constructs from '../lib/constructs-stack'; | ||
import {ConstructsStack} from '../lib/constructs-stack'; | ||
import TestTemplate from './serverless-image-handler-test.json'; | ||
|
||
test('Serverless Image Handler Stack', () => { | ||
const app = new cdk.App(); | ||
// WHEN | ||
const stack = new Constructs.ConstructsStack(app, 'MyTestStack'); | ||
const stack = new ConstructsStack(app, 'MyTestStack'); | ||
// THEN | ||
expectCDK(stack).to(matchTemplate(TestTemplate, MatchStyle.EXACT)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters