Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #27 from hayd/sar
Browse files Browse the repository at this point in the history
Publish to SAR
  • Loading branch information
hayd authored Jan 13, 2020
2 parents 9688cc8 + c3713d2 commit 0ffe8ac
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Run tests
run: |
docker run test-runner
- name: Create artifacts
- name: Extract artifacts
run: |
docker cp extract:/bin/deno amz-deno
docker cp extract:/src/runtime/deno-lambda-layer.zip deno-lambda-layer.zip
Expand All @@ -30,3 +30,26 @@ jobs:
deno-lambda-layer.zip
deno-lambda-example.zip
draft: true
- name: Publish to SAR
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'hayd/deno-lambda'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DENO_LAMBDA_BUCKET: ${{ secrets.DENO_LAMBDA_BUCKET }}
run: |
export DENO_LAMBDA_VERSION=$(echo $GITHUB_REF | tr / '\n' | tail -n 1)
echo tag: $DENO_LAMBDA_VERSION
# FIXME: Installation of sam is fiddly.
export DEBIAN_FRONTEND=noninteractive
sudo apt -qq update &> /dev/null
sudo apt -qq install -y awscli python3-setuptools &> /dev/null
aws s3 cp --quiet deno-lambda-layer.zip s3://$DENO_LAMBDA_BUCKET/deno-lambda-layer_$DENO_LAMBDA_VERSION.zip --acl public-read
cd layer
sed -i -e s/DENO_LAMBDA_BUCKET/$DENO_LAMBDA_BUCKET/g template.yml
sed -i -e s/DENO_LAMBDA_VERSION/$DENO_LAMBDA_VERSION/g template.yml
pip3 -q install -U --force pip
export PATH=/home/runner/.local/bin:$PATH
export SAM_CLI_TELEMETRY=1
python3 -m pip -q install --user aws-sam-cli
cat template.yml
sam publish --region us-east-1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.deno_dir
.serverless
node_modules
*.zip
15 changes: 15 additions & 0 deletions layer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Deno Lambda Layer

A custom runtime for [deno](https://github.com/denoland/deno) applications.

See the [README on github](https://github.com/hayd/deno-lambda) for more information.

---

Made with ❤️ by Andy Hayden.
Available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless).


## License

MIT
34 changes: 34 additions & 0 deletions layer/template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
A custom runtime for deno
Resources:
DenoLambdaLayer:
Type: AWS::Lambda::LayerVersion
Properties:
LayerName: Deno
Description: A custom runtime for deno
Content:
S3Bucket: DENO_LAMBDA_BUCKET
S3Key: deno-lambda-layer_DENO_LAMBDA_VERSION.zip

Outputs:
DenoArn:
Value: !Ref DenoLambdaLayer

Metadata:
AWS::ServerlessRepo::Application:
Name: Deno
Description: |
A custom runtime for deno
Author: Andy Hayden
SpdxLicenseId: MIT
Labels:
- deno
- layer
- lambda
- typescript
HomePageUrl: https://github.com/hayd/deno-lambda
SemanticVersion: DENO_LAMBDA_VERSION
SourceCodeUrl: https://github.com/hayd/deno-lambda

0 comments on commit 0ffe8ac

Please sign in to comment.