-
Notifications
You must be signed in to change notification settings - Fork 35
63 lines (62 loc) · 1.98 KB
/
publish.yaml
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
53
54
55
56
57
58
59
60
61
62
63
---
name: Publish Version
on:
release:
types: [created, edited]
jobs:
publish:
name: Publish Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch Tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
aws-region: ${{ secrets.REGION }}
- name: Set version
id: version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
# Cache
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# Setup
- name: Install Snappy
run: sudo apt-get install libsnappy-dev
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Set up Nodejs 16
uses: actions/setup-node@v1
with:
node-version: 16
- name: Set up ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Install virtualenv
run: pip install virtualenv
- name: Install dependencies
run: make setup
# Package and Upload Archive
- name: Build Release
run: make package
- name: Upload artefact
run: aws s3 cp packaged.zip s3://$CFN_BUCKET/amazon-s3-find-and-forget/$VERSION/amazon-s3-find-and-forget.zip
env:
CFN_BUCKET: ${{ secrets.CFN_BUCKET }}