-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (31 loc) · 961 Bytes
/
ci-cd.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
name: BuildNDeploy
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: olegtarasov/get-tag@v1
id: tagName
- name: Log Build Number
run : echo 'Build ${{ github.run_number }}'
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Check out Code
uses: actions/checkout@v2
- name: Run Tests
run: go test ./...
- name: Build and Publish Code
uses: ./.github/shell
env:
GOROOT: /usr/local/go
with:
args: |
cd cli
gox -os='linux' -os='windows' -ldflags '-X main.version=${{ steps.tagName.outputs.tag }}.${{ github.run_number }}' -output 'artifacts/cstore_{{.OS}}_{{.Arch}}'
ghr -t '${{ secrets.GITHUB_TOKEN }}' -u turnerlabs -r cstore -c $GITHUB_SHA -delete ${{ steps.tagName.outputs.tag }} artifacts