Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BuildRelease = func(release *Release) error { for _, t := range release.Targets { if err := Build(&t); err != nil { return err } } return nil }
View Source
var ErrorBlankFileName = errors.New("target has blank file name")
View Source
var ErrorDuplicateNames = errors.New("release has targets with duplicate names")
View Source
var ErrorVersionNotSet = errors.New("version is not set")
Functions ¶
Types ¶
type BuildReleaseFunc ¶
type FileBuild ¶
type FileBuild struct { Name string // file name BinPath string // final path of built executable Env []string // env passed to go build Args []string // args passed to go build GOOS string GOARCH string }
func MakeFileBuild ¶
MakeFileBuild creates FileBuild for Target
type PrepareFunc ¶
var Prepare PrepareFunc = func(release *Release) error { if release.Version == "" { return ErrorVersionNotSet } if isAllPlatforms(release.Platforms) { release.Platforms = DistList() } glob := release for i, t := range release.Targets { if t.Version == "" { t.Version = glob.Version } if t.DestDir == "" { t.DestDir = glob.DestDir } if t.FilePath == "" { return ErrorBlankFileName } if t.Name == "" { t.Name = glob.Name } if t.Env == nil { t.Env = glob.Env } if t.Flags == nil { t.Flags = glob.Flags } if isAllPlatforms(t.Platforms) { t.Platforms = DistList() } if t.Platforms == nil { t.Platforms = glob.Platforms } for goos, goarchs := range t.Platforms { for _, goarch := range goarchs { build := MakeFileBuild(t, goos, goarch) t.FileBuilds = append(t.FileBuilds, build) } } release.Targets[i] = t } if hasDuplicateNames(release) { return ErrorDuplicateNames } return nil }
Prepare is a basic PrepareFunc
type Release ¶
func (*Release) ForEachTarget ¶
ForEach performs func f for each Target in Release
type ReleaseFunc ¶
func GCSRelease ¶
func GCSRelease(bucket string, result GCSResult) ReleaseFunc
GCSRelease is Google Cloud Storage ReleaseFunc
type Target ¶
type Target struct { FilePath string `yaml:"file"` // file to compile Name string `yaml:"name"` // name of executable Version string `yaml:"version"` // version of release DestDir string `yaml:"dir"` // dir when bin is stored Env map[string]string `yaml:"env"` // env passed to go build Flags []string `yaml:"flags"` // flags passed to go build Platforms map[string][]string `yaml:"platforms"` // for what platforms build FileBuilds []FileBuild `yaml:"-"` }
Click to show internal directories.
Click to hide internal directories.