mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
commit
e3edf89523
@ -3,5 +3,10 @@ binary_name: release
|
||||
brew:
|
||||
repo: goreleaser/homebrew-formulae
|
||||
build:
|
||||
arches:
|
||||
- amd64
|
||||
arches:
|
||||
- amd64
|
||||
- 386
|
||||
oses:
|
||||
- windows
|
||||
- darwin
|
||||
- linux
|
||||
|
@ -51,7 +51,7 @@ func create(system, arch string, config config.ProjectConfig) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := addFile(tw, config.BinaryName, binaryName(system, arch, config.BinaryName)); err != nil {
|
||||
if err := addFile(tw, config.BinaryName+ext(system), binaryPath(system, arch, config.BinaryName)); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -85,6 +85,13 @@ func nameFor(system, arch, binary string) string {
|
||||
return binary + "_" + uname.FromGo(system) + "_" + uname.FromGo(arch)
|
||||
}
|
||||
|
||||
func binaryName(system, arch, binary string) string {
|
||||
func binaryPath(system, arch, binary string) string {
|
||||
return "dist/" + nameFor(system, arch, binary) + "/" + binary
|
||||
}
|
||||
|
||||
func ext(system string) string {
|
||||
if system == "windows" {
|
||||
return ".exe"
|
||||
}
|
||||
return ""
|
||||
}
|
14
pipeline/compress/compress_test.go
Normal file
14
pipeline/compress/compress_test.go
Normal file
@ -0,0 +1,14 @@
|
||||
package compress
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestExtWindows(t *testing.T) {
|
||||
assert.Equal(t, ext("windows"), ".exe")
|
||||
}
|
||||
|
||||
func TestExtOthers(t *testing.T) {
|
||||
assert.Empty(t, ext("linux"))
|
||||
}
|
@ -6,6 +6,7 @@ var mapping = map[string]string{
|
||||
"freebsd": "FreeBSD",
|
||||
"openbsd": "OpenBSD",
|
||||
"netbsd": "NetBSD",
|
||||
"windows": "Windows",
|
||||
"386": "i386",
|
||||
"amd64": "x86_64",
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user