-
Notifications
You must be signed in to change notification settings - Fork 6
36 lines (34 loc) · 1009 Bytes
/
build.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
name: Build
on:
push:
paths-ignore: [ '**.md' ]
pull_request:
paths-ignore: [ '**.md' ]
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: ['amd64', 'arm64']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.16'
# https://stackoverflow.com/questions/3861634/how-to-reduce-compiled-file-size
- name: Build
run: |
go build -ldflags="-s -w" -o node-linux-$GOARCH
upx node-linux-$GOARCH
sha256sum node-linux-$GOARCH > node-linux-$GOARCH.sha256
env:
GOARCH: ${{ matrix.arch }}
- name: Upload
if: github.event_name == 'release'
run: gh release upload --clobber $TAG_NAME node-linux-$GOARCH node-linux-$GOARCH.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOARCH: ${{ matrix.arch }}
TAG_NAME: ${{ github.event.release.tag_name }}