-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 1.19 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
# .github/workflows/release.yaml
name: Build Release
on:
release:
types: [ created ]
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
goos: [ linux ]
goarch: [ "386", arm, amd64 ]
steps:
- uses: actions/checkout@v2
- name: Set APP_VERSION env
run: echo "APP_VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev )" >> $GITHUB_ENV
- name: Set BUILD_TIME env
run: echo "BUILD_TIME=$(date --rfc-3339=seconds | sed 's/ /T/')" >> $GITHUB_ENV
- uses: wangyoucao577/go-release-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz"
project_path: "./cmd"
binary_name: "night-watch"
extra_files: "config.yaml.sample README.md"
ldflags: -X "github.com/ingrowco/night-watch/configurator.AppVersion=${{ env.APP_VERSION }}" -X "github.com/ingrowco/night-watch/configurator.BuildTime=${{ env.BUILD_TIME }}" -X github.com/ingrowco/night-watch/configurator.GitCommit=${{ github.sha }} -s -w