Documentation ¶
Overview ¶
Package artifact provides the core artifact storage for goreleaser.
Index ¶
- Constants
- func OnlyReplacingUnibins(a *Artifact) bool
- type Artifact
- type Artifacts
- func (artifacts *Artifacts) Add(a *Artifact)
- func (artifacts *Artifacts) Filter(filter Filter) Artifacts
- func (artifacts Artifacts) GroupByPlatform() map[string][]*Artifact
- func (artifacts Artifacts) List() []*Artifact
- func (artifacts Artifacts) Paths() []string
- func (artifacts *Artifacts) Remove(filter Filter) error
- func (artifacts Artifacts) Visit(fn VisitFn) error
- type Extras
- type Filter
- type Type
- type VisitFn
Constants ¶
const ( ExtraID = "ID" ExtraBinary = "Binary" ExtraExt = "Ext" ExtraBuilds = "Builds" ExtraFormat = "Format" ExtraWrappedIn = "WrappedIn" ExtraBinaries = "Binaries" ExtraRefresh = "Refresh" ExtraReplaces = "Replaces" )
Variables ¶
This section is empty.
Functions ¶
func OnlyReplacingUnibins ¶ added in v1.2.0
OnlyReplacingUnibins removes universal binaries that did not replace the single-arch ones.
This is useful specially on homebrew et al, where you'll want to use only either the single-arch or the universal binaries.
Types ¶
type Artifact ¶
type Artifact struct { Name string `json:"name,omitempty"` Path string `json:"path,omitempty"` Goos string `json:"goos,omitempty"` Goarch string `json:"goarch,omitempty"` Goarm string `json:"goarm,omitempty"` Gomips string `json:"gomips,omitempty"` Type Type `json:"type,omitempty"` Extra Extras `json:"extra,omitempty"` }
Artifact represents an artifact and its relevant info.
func (Artifact) Checksum ¶ added in v0.84.0
Checksum calculates the checksum of the artifact. nolint: gosec
func (Artifact) ExtraOr ¶ added in v0.96.0
ExtraOr returns the Extra field with the given key or the or value specified if it is nil.
func (Artifact) Format ¶ added in v0.183.0
Format returns the artifact Format if it exists, empty otherwise.
type Artifacts ¶
type Artifacts struct {
// contains filtered or unexported fields
}
Artifacts is a list of artifacts.
func (*Artifacts) Filter ¶
Filter filters the artifact list, returning a new instance. There are some pre-defined filters but anything of the Type Filter is accepted. You can compose filters by using the And and Or filters.
func (Artifacts) GroupByPlatform ¶
GroupByPlatform groups the artifacts by their platform.
func (Artifacts) Paths ¶ added in v0.154.0
Paths returns the artifact.Path of the current artifact list.
type Extras ¶ added in v1.2.0
type Extras map[string]interface{}
Extras represents the extra fields in an artifact.
func (Extras) MarshalJSON ¶ added in v1.2.0
type Filter ¶
Filter defines an artifact filter which can be used within the Filter function.
type Type ¶
type Type int
Type defines the type of an artifact.
const ( // UploadableArchive a tar.gz/zip archive to be uploaded. UploadableArchive Type = iota + 1 // UploadableBinary is a binary file to be uploaded. UploadableBinary // UploadableFile is any file that can be uploaded. UploadableFile // Binary is a binary (output of a gobuild). Binary // UniversalBinary is a binary that contains multiple binaries within. UniversalBinary // LinuxPackage is a linux package generated by nfpm. LinuxPackage // PublishableSnapcraft is a snap package yet to be published. PublishableSnapcraft // Snapcraft is a published snap package. Snapcraft // PublishableDockerImage is a Docker image yet to be published. PublishableDockerImage // DockerImage is a published Docker image. DockerImage // DockerManifest is a published Docker manifest. DockerManifest // Checksum is a checksums file. Checksum // Signature is a signature file. Signature // Certificate is a signing certificate file Certificate // UploadableSourceArchive is the archive with the current commit source code. UploadableSourceArchive // BrewTap is an uploadable homebrew tap recipe file. BrewTap // GoFishRig is an uploadable Rigs rig food file. GoFishRig // KrewPluginManifest is a krew plugin manifest file. KrewPluginManifest // ScoopManifest is an uploadable scoop manifest file. ScoopManifest // SBOM is a Software Bill of Materials file. SBOM )