Skip to content

Commit d130cca

Browse files
committed
add go releaser
1 parent 32fbefb commit d130cca

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
*.out
1313

1414
vendor/
15+
dist/

.goreleaser.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
builds:
6+
- env:
7+
- CGO_ENABLED=0
8+
binary: hashnode
9+
archive:
10+
replacements:
11+
darwin: Darwin
12+
linux: Linux
13+
windows: Windows
14+
386: i386
15+
amd64: x86_64
16+
checksum:
17+
name_template: 'checksums.txt'
18+
snapshot:
19+
name_template: "{{ .Tag }}-next"
20+
changelog:
21+
sort: asc
22+
filters:
23+
exclude:
24+
- '^docs:'
25+
- '^test:'

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM golang:1.11 AS build
2+
WORKDIR /go/src/github.com/hashnode/hashnode-cli
3+
4+
RUN go get github.com/golang/dep/cmd/dep
5+
COPY Gopkg.toml Gopkg.lock ./
6+
RUN dep ensure -v -vendor-only
7+
8+
COPY cmd cmd
9+
COPY pkg pkg
10+
RUN CGO_ENABLED=0 GOOS=linux GOFLAGS=-ldflags=-w go build -o /go/bin/hashnode -ldflags=-s -v github.com/hashnode/hashnode-cli
11+
12+
FROM alpine:3.8 AS final
13+
RUN apk --no-cache add ca-certificates
14+
COPY --from=build /go/bin/hashnode /bin/hashnode
15+
ENTRYPOINT ["hashnode"]

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
hashnode:
22
go install github.com/hashnode/hashnode-cli
3+
dry-release:
4+
goreleaser release --skip-publish --snapshot --rm-dist

0 commit comments

Comments
 (0)