-
Notifications
You must be signed in to change notification settings - Fork 52
42 lines (34 loc) · 1.15 KB
/
build-release-assets.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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build Release Assets
on:
workflow_dispatch:
release:
types: [published]
jobs:
releases-matrix:
name: Release Zip
runs-on: ubuntu-latest
strategy:
matrix:
make_directive: [zip-x86_64, zip-arm64]
steps:
- uses: actions/checkout@v3
- name: set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: make zip
run: make ${{ matrix.make_directive }}
- name: upload artifact
env:
AUTH_TOKEN: ${{ secrets.RELEASE_ASSET_TOKEN }}
run: |
tag=$(gh release list --json tagName -q '.[0].tagName')
file=/tmp/newrelic-lambda-extension.arm64.zip
if [ -f /tmp/newrelic-lambda-extension.x86_64.zip ];then
file=/tmp/newrelic-lambda-extension.x86_64.zip
fi
echo "uploading $file to release $tag"
gh auth login --with-token <<< "$AUTH_TOKEN"
gh release upload "$tag" "$file"