generated from agendrix/terraform-aws-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.26 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Release
on:
release:
types: [prereleased, edited, released]
jobs:
build:
name: Build AWS lambda function
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: "main"
- name: Install dependencies
run: yarn install
- name: Get release tag
id: ref
run: |
TAG=${REF#"$PREFIX"}
echo "::set-output name=tag::$TAG"
env:
REF: ${{ github.ref }}
PREFIX: "refs/tags/"
- name: Update package.json version
run: |
tmp=$(mktemp)
jq '.version = "${{ steps.ref.outputs.tag }}"' package.json > "$tmp"
mv "$tmp" package.json
- name: Build lambda distribution
run: yarn dist
- name: Setup GitHub git user
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Push builds
run: |
git add package.json terraform/lambda.zip
git commit -m "Build app for release ${{ steps.ref.outputs.tag }}"
git push
- name: Move release tag to latest commit
run: |
git tag --force "${{ steps.ref.outputs.tag }}" $(git rev-parse HEAD)
git push --force --tags