Skip to content

Commit 6547c6e

Browse files
committed
- [+] added goreleaser build .yml, 2nd part of CI auto build
1 parent 22228ff commit 6547c6e

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
-
15+
name: Set up Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.15
19+
20+
-
21+
name: Checkout
22+
uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
26+
-
27+
name: Tests
28+
run: |
29+
export GOPATH=/home/runner/go
30+
mkdir -p $GOPATH/src/github.com/`dirname $GITHUB_REPOSITORY`
31+
mv $GITHUB_WORKSPACE $GOPATH/src/github.com/$GITHUB_REPOSITORY
32+
ln -s $GOPATH/src/github.com/$GITHUB_REPOSITORY $GITHUB_WORKSPACE
33+
# go mod tidy
34+
go get -v ./...
35+
go test -v ./...
36+
37+
-
38+
name: Run GoReleaser
39+
uses: goreleaser/goreleaser-action@v2
40+
if: success() && startsWith(github.ref, 'refs/tags/')
41+
with:
42+
version: latest
43+
args: release --rm-dist
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,19 @@
22

33
language: go
44

5+
env:
6+
global:
7+
- VERSION="${TRAVIS_TAG:=0.0~git$(date +%Y%m%d)-1}"
8+
# Build time setup
9+
- TZ=America/Toronto
10+
- DATE_BUILD=`date -I`
11+
512
script:
613

14+
- date
15+
- echo $DATE_BUILD $VERSION
16+
- echo
17+
718
- go get -t -v ./...
819
- go build -v -ldflags="-X main.date=$DATE_BUILD"
920
- wireframe

0 commit comments

Comments
 (0)