1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00

Merge branch 'master' into init-command

This commit is contained in:
Carlos Alexandro Becker 2017-04-28 12:56:12 -03:00 committed by GitHub
commit bae5c9e91d
3 changed files with 53 additions and 25 deletions

View File

@ -3,30 +3,15 @@
<h3 align="center">GoReleaser</h3>
<p align="center">Deliver Go binaries as fast and easily as possible.</p>
<p align="center">
<a href="https://github.com/goreleaser/goreleaser/releases/latest">
<img alt="Release" src="https://img.shields.io/github/release/goreleaser/goreleaser.svg?style=flat-square">
</a>
<a href="/goreleaser/goreleaser/blob/master/LICENSE.md">
<img alt="Software License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square">
</a>
<a href="https://travis-ci.org/goreleaser/goreleaser">
<img alt="Travis" src="https://img.shields.io/travis/goreleaser/goreleaser.svg?style=flat-square">
</a>
<a href="https://codecov.io/gh/goreleaser/goreleaser">
<img alt="Codecov branch" src="https://img.shields.io/codecov/c/github/goreleaser/goreleaser/master.svg?style=flat-square">
</a>
<a href="https://goreportcard.com/report/github.com/goreleaser/goreleaser">
<img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/goreleaser/goreleaser?style=flat-square">
</a>
<a href="http://godoc.org/github.com/goreleaser/goreleaser">
<img alt="Go Doc" src="https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square">
</a>
<a href="https://saythanks.io/to/caarlos0">
<img alt="SayThanks.io" src="https://img.shields.io/badge/SayThanks.io-%E2%98%BC-1EAEDB.svg?style=flat-square">
</a>
<a href="https://github.com/goreleaser">
<img alt="Powered By: GoReleaser" src="https://img.shields.io/badge/powered%20by-goreleaser-green.svg?style=flat-square">
</a>
<a href="/releases/latest"><img alt="Release" src="https://img.shields.io/github/release/goreleaser/goreleaser.svg?style=flat-square"></a>
<a href="/LICENSE.md"><img alt="Software License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square"></a>
<a href="https://travis-ci.org/goreleaser/goreleaser"><img alt="Travis" src="https://img.shields.io/travis/goreleaser/goreleaser.svg?style=flat-square"></a>
<a href="https://codecov.io/gh/goreleaser/goreleaser"><img alt="Codecov branch" src="https://img.shields.io/codecov/c/github/goreleaser/goreleaser/master.svg?style=flat-square"></a>
<a href="https://goreportcard.com/report/github.com/goreleaser/goreleaser"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/goreleaser/goreleaser?style=flat-square"></a>
<a href="http://godoc.org/github.com/goreleaser/goreleaser"><img alt="Go Doc" src="https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square"></a>
<a href="https://beerpay.io/goreleaser/goreleaser"><img src="https://beerpay.io/goreleaser/goreleaser/badge.svg?style=flat-square" /></a>
<a href="https://saythanks.io/to/caarlos0"><img alt="SayThanks.io" src="https://img.shields.io/badge/SayThanks.io-%E2%98%BC-1EAEDB.svg?style=flat-square"></a>
<a href="https://github.com/goreleaser"><img alt="Powered By: GoReleaser" src="https://img.shields.io/badge/powered%20by-goreleaser-green.svg?style=flat-square"></a>
</p>
</p>

View File

@ -144,6 +144,49 @@ func TestRunPipeWithInvalidOS(t *testing.T) {
assert.NoError(Pipe{}.Run(ctx))
}
func TestRunInvalidNametemplate(t *testing.T) {
var assert = assert.New(t)
var ctx = &context.Context{
Config: config.Project{
Build: config.Build{
Binary: "nametest",
Flags: "-v",
Goos: []string{
runtime.GOOS,
},
Goarch: []string{
runtime.GOARCH,
},
},
Archive: config.Archive{
NameTemplate: "{{.Binary}_{{.Os}}_{{.Arch}}_{{.Version}}",
},
},
}
assert.Error(Pipe{}.Run(ctx))
}
func TestRunInvalidLdflags(t *testing.T) {
var assert = assert.New(t)
var ctx = &context.Context{
Archives: map[string]string{},
Config: config.Project{
Build: config.Build{
Binary: "nametest",
Flags: "-v",
Ldflags: "-s -w -X main.version={{.Version}",
Goos: []string{
runtime.GOOS,
},
Goarch: []string{
runtime.GOARCH,
},
},
},
}
assert.Error(Pipe{}.Run(ctx))
}
func TestRunPipeFailingHooks(t *testing.T) {
assert := assert.New(t)
var config = config.Project{

View File

@ -50,7 +50,7 @@ func TestInvalidNameTemplate(t *testing.T) {
var config = config.Project{
Archive: config.Archive{
NameTemplate: "{{.Binaryyy}}_{{.Os}}_{{.Arch}}_{{.Version}}",
NameTemplate: "{{.Binary}_{{.Os}}_{{.Arch}}_{{.Version}}",
},
Build: config.Build{
Binary: "test",