Skip to content

Commit

Permalink
fix issue #69: complete goreleaser.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Aug 10, 2017
1 parent 846564f commit c162798
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Makefile
Expand Up @@ -69,7 +69,10 @@ test-cmd:
-v '$(GOPATH)/src/$(GO_PACKAGE)':'/go/src/$(GO_PACKAGE)' \
-w '/go/src/$(GO_PACKAGE)' \
golang:1.7 \
/bin/sh -c 'go install -ldflags "-X 'main.Version=test'" ./cmd/semaphore \
/bin/sh -c 'go install -ldflags "-s -w -X main.version=test \
-X main.commit=$(GIT_REV) \
-X main.date=$(DATE)" \
./cmd/semaphore \
&& semaphore create --capacity=1 --timeout=10s \
&& semaphore add -- curl example.com \
&& semaphore add -- curl example.com \
Expand Down
7 changes: 7 additions & 0 deletions cmd/semaphore/build.go
@@ -0,0 +1,7 @@
package main

var (
commit = "none"
date = "unknown"
version = "dev"
)
1 change: 1 addition & 0 deletions cmd/semaphore/main.go
Expand Up @@ -9,4 +9,5 @@ import (
func main() {
flag.Parse()
fmt.Println(strings.Join(flag.Args(), ", "))
fmt.Println(commit, date, version)
}
4 changes: 2 additions & 2 deletions goreleaser.yml
@@ -1,5 +1,5 @@
homepage: &home https://github.com/kamilsk/semaphore
description: &desc Semaphore pattern implementation with timeout of lock/unlock operations based on channels.
description: &desc Semaphore pattern implementation with a timeout of lock/unlock operations based on channels.

archive:
files:
Expand Down Expand Up @@ -37,7 +37,7 @@ build:
- darwin
- linux
- windows
ldflags: -s -w -X 'main.Version="{{.Version}} ({{.Date}})"'
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
main: ./cmd/semaphore

release:
Expand Down
2 changes: 1 addition & 1 deletion makes/env.mk
Expand Up @@ -4,7 +4,7 @@ endif

CWD := $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST)))))
CID := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
DATE := $(shell date -u "+%Y-%m-%d %H:%M:%S")
DATE := $(shell date -u "+%Y-%m-%d_%H:%M:%S")
GO_VERSION := $(shell go version | awk '{print $$3}' | tr -d 'go')

GIT_REV := $(shell git rev-parse --short HEAD)
Expand Down

0 comments on commit c162798

Please sign in to comment.