This repository has been archived by the owner on Sep 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.69 KB
/
release.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Release
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v2
with:
go-version: 1.13
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build
run: sh ./.build/build.sh
release:
name: Release
runs-on: ubuntu-latest
needs: build
env:
GIT_AUTHOR_EMAIL: [email protected]
GIT_AUTHOR_NAME: stackhead-bot
GIT_COMMITTER_EMAIL: [email protected]
GIT_COMMITTER_NAME: stackhead-bot
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.15
- run: |
go get github.com/mitchellh/gox
go get github.com/tcnksm/ghr
- uses: actions/checkout@v2
- uses: go-semantic-release/action@v1
id: semrel
with:
github-token: ${{ secrets.GH_TOKEN }}
ghr: true
- run: |
gox -parallel 4 -osarch="linux/amd64 darwin/amd64 linux/arm windows/amd64" -ldflags="-extldflags '-static' -s -w -X github.com/getstackhead/stackhead-cli/main.VERSION=${{steps.semrel.outputs.version}}" -output="bin/{{.Dir}}_v${{steps.semrel.outputs.version}}_{{.OS}}_{{.Arch}}" .
cd bin/ && shasum -a 256 * > ./stackhead-cli_v${{steps.semrel.outputs.version}}_checksums.txt && cd -
if: steps.semrel.outputs.version != ''
env:
CGO_ENABLED: 0
- run: ghr $(cat .ghr) bin/
if: steps.semrel.outputs.version != ''
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}