-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (80 loc) · 3.13 KB
/
release.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build & publish
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
required: true
type: string
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
build-package:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [ 'amd64', 'arm64' ]
steps:
- uses: actions/checkout@v3
- name: Set RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build & package layers (amd64 & arm64)
run: |
make package ARCH=${{ matrix.arch }} VERSION=$RELEASE_VERSION
- name: Upload package as artifact
uses: actions/upload-artifact@v3
with:
name: firetail-lambda-extension-${{ matrix.arch }}-${{ env.RELEASE_VERSION }}
path: build/firetail-extension-${{ matrix.arch }}-${{ env.RELEASE_VERSION }}.zip
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload release binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: build/firetail-extension-${{ matrix.arch }}-${{ env.RELEASE_VERSION }}.zip
asset_name: firetail-extension-${{ matrix.arch }}-${{ env.RELEASE_VERSION }}.zip
asset_content_type: application/zip
publish-package:
runs-on: ubuntu-latest
needs: build-package
strategy:
matrix:
aws-region: [ 'eu-west-1', 'eu-west-2', 'ap-southeast-1', 'ap-southeast-2', 'us-west-1', 'us-west-2', 'us-east-1' ]
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ matrix.aws-region }}
role-to-assume: arn:aws:iam::247286868737:role/firetail-prod-github-release-access
role-session-name: github
- uses: actions/checkout@v3
- name: Set RELEASE_VERSION
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Download amd64 package artifact
uses: actions/download-artifact@v3
with:
name: firetail-lambda-extension-amd64-${{ env.RELEASE_VERSION }}
path: build
- name: Download arm64 package artifact
uses: actions/download-artifact@v3
with:
name: firetail-lambda-extension-arm64-${{ env.RELEASE_VERSION }}
path: build
- name: Publish amd64 layer to AWS
run: |
AWS_LAYER_VERSION=$(make publish ARCH=amd64 VERSION=$RELEASE_VERSION AWS_REGION=${{ matrix.aws-region }})
make public ARCH=amd64 AWS_LAYER_VERSION=$AWS_LAYER_VERSION VERSION=$RELEASE_VERSION AWS_REGION=${{ matrix.aws-region }}
- name: Publish arm64 layer to AWS
run: |
AWS_LAYER_VERSION=$(make publish ARCH=arm64 VERSION=$RELEASE_VERSION AWS_REGION=${{ matrix.aws-region }})
make public ARCH=arm64 AWS_LAYER_VERSION=$AWS_LAYER_VERSION VERSION=$RELEASE_VERSION AWS_REGION=${{ matrix.aws-region }}