Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add release task #4

Merged
merged 1 commit into from
Feb 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/kroki
/dist/
28 changes: 28 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
project_name: kroki-cli

before:
hooks:
- go mod download

builds:
- env:
- CGO_ENABLED=0
- binary: kroki
goos:
- windows
- darwin
- linux
- openbsd
goarch:
- amd64

archive:
format_overrides:
- goos: windows
format: zip

release:
github:
owner: yuzutech
name: kroki-cli
draft: true
22 changes: 20 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,23 @@ install:
- go mod vendor

script:
- go test -race ./...
- golangci-lint run .
- make test
- make lint

jobs:
include:
- stage: goreleaser-snapshot
go: "1.11.x"
script:
- curl -sL https://git.io/goreleaser | head -n -2 | bash
- tar -xf /tmp/goreleaser.tar.gz -C $GOPATH/bin
- goreleaser --snapshot --skip-sign
- stage: goreleaser-release
go: "1.11.x"
if: |
repo = 'yuzutech/kroki-cli' AND \
tag IS present
script:
- curl -sL https://git.io/goreleaser | head -n -2 | bash
- tar -xf /tmp/goreleaser.tar.gz -C $GOPATH/bin
- goreleaser --skip-sign
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version := $(shell git describe --exact-match --tags $(git log -n1 --pretty='%h') 2> /dev/null || echo 'latest')
vcs_ref := $(shell git rev-parse HEAD)

GO_FILES = $(shell find . -type f -name '*.go')

.PHONY: all
all: clean kroki

kroki: $(GO_FILES)
go build -o $@ -ldflags "-s -w -X main.version=${version} -X main.commit=${vcs_ref}"

.PHONY: lint
lint: $(GO_FILES)
golangci-lint run ./...

.PHONY: test
test: $(GO_FILES)
go test -race ./...

.PHONY: clean
clean:
go clean
rm -rf kroki