Skip to content

Commit d613a0d

Browse files
authored
Merge pull request #72 from simeji/use_goreleaser
Use goreleaser
2 parents b5d8918 + e35ecb5 commit d613a0d

File tree

6 files changed

+84
-46
lines changed

6 files changed

+84
-46
lines changed

.circleci/config.yml

+10-45
Original file line numberDiff line numberDiff line change
@@ -5,61 +5,26 @@ jobs:
55
- image: circleci/golang:latest
66
steps:
77
- checkout
8-
- run: go get -v -t -d ./...
98
- run: go test -v ./
109
- run: go test -v ./cmd/jid
11-
build:
10+
release:
1211
docker:
1312
- image: circleci/golang:latest
1413
steps:
1514
- checkout
1615
- run:
17-
name: update packages
18-
command: go get -v -t -d ./...
19-
- run:
20-
name: install gox
21-
command: go get github.com/mitchellh/gox
22-
- run:
23-
name: build jid
24-
command: cd cmd/jid && gox -ldflags '-w -s'
25-
- persist_to_workspace:
26-
root: .
27-
paths:
28-
- cmd/jid/*
29-
deploy:
30-
docker:
31-
- image: circleci/golang:latest
32-
steps:
33-
- attach_workspace:
34-
at: .
35-
- run:
36-
name: make a zip dir
37-
command: mkdir builds
38-
- run:
39-
name: create zip files
40-
command: |
41-
for name in `cd cmd/jid && find jid_* | grep -v .go`; do
42-
zip builds/${name}.zip cmd/jid/$name
43-
done
44-
- run:
45-
name: list binary
46-
command: ls builds
16+
name: build jid using goreleaser
17+
command: curl -sL https://git.io/goreleaser | bash
4718
workflows:
4819
version: 2
49-
build_and_deploy:
20+
test_and_release:
5021
jobs:
5122
- test
52-
- build:
23+
- release:
5324
requires:
5425
- test
55-
# filters:
56-
# tags:
57-
# only: /.*/
58-
- deploy:
59-
requires:
60-
- build
61-
# filters:
62-
# tags:
63-
# only: /.*/
64-
# branches:
65-
# only: master
26+
filters:
27+
branches:
28+
ignore: /.*/
29+
tags:
30+
only: /v[0-9]+(\.[0-9]+)*(-.*)*/

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ test.*
2929
# jid package
3030
jid
3131
*.out
32+
*.log
33+
dist

.goreleaser.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This is an example goreleaser.yaml file with some sane defaults.
2+
# Make sure to check the documentation at http://goreleaser.com
3+
before:
4+
hooks:
5+
# you may remove this if you don't use vgo
6+
- go mod download
7+
# you may remove this if you don't need go generate
8+
- go generate ./...
9+
builds:
10+
- env:
11+
- CGO_ENABLED=0
12+
main: ./cmd/jid/jid.go
13+
ldflags:
14+
- -s -w
15+
goos:
16+
- windows
17+
- openbsd
18+
- netbsd
19+
- linux
20+
- freebsd
21+
- darwin
22+
goarch:
23+
- arm64
24+
- amd64
25+
- 386
26+
archive:
27+
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
28+
format: zip
29+
files:
30+
- none*
31+
checksum:
32+
name_template: 'checksums.txt'
33+
snapshot:
34+
name_template: "{{ .Tag }}-next"
35+
changelog:
36+
sort: asc
37+
filters:
38+
exclude:
39+
- '^docs:'
40+
- '^test:'
41+
# for Validation
42+
#release:
43+
# disable: true

cmd/jid/jid.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/simeji/jid"
99
)
1010

11-
const VERSION = "0.7.2"
11+
const VERSION = "0.7.3"
1212

1313
func main() {
1414
content := os.Stdin

go.mod

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module github.com/simeji/jid
2+
3+
require (
4+
github.com/bitly/go-simplejson v0.5.0
5+
github.com/fatih/color v1.7.0 // indirect
6+
github.com/mattn/go-colorable v0.0.9 // indirect
7+
github.com/mattn/go-isatty v0.0.4 // indirect
8+
github.com/mattn/go-runewidth v0.0.4
9+
github.com/nsf/termbox-go v0.0.0-20181027232701-60ab7e3d12ed
10+
github.com/nwidger/jsoncolor v0.0.0-20170215171346-75a6de4340e5
11+
github.com/pkg/errors v0.8.0
12+
)

go.sum

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=
2+
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
3+
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
4+
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
5+
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
6+
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
7+
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
8+
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
9+
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
10+
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
11+
github.com/nsf/termbox-go v0.0.0-20181027232701-60ab7e3d12ed h1:bAVGG6B+R5qpSylrrA+BAMrzYkdAoiTaKPVxRB+4cyM=
12+
github.com/nsf/termbox-go v0.0.0-20181027232701-60ab7e3d12ed/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
13+
github.com/nwidger/jsoncolor v0.0.0-20170215171346-75a6de4340e5 h1:d+C3xJdxZT7wNlxqEwbXn3R355CwAhYBL9raVNfSnK0=
14+
github.com/nwidger/jsoncolor v0.0.0-20170215171346-75a6de4340e5/go.mod h1:GYFm0zZgTNeoK1QxuIofRDasy2ibmaJZhZLzwsMXUF4=
15+
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
16+
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

0 commit comments

Comments
 (0)