Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangePusher ¶
type ChangePusher interface {
// The error value may be ErrAlreadyUpdated if the repo has already been updated
UpdateAndPush(
ctx context.Context,
version string,
versionSha string,
branchName string,
commitMessage string,
perPlatformShas *PerPlatformSha256,
formulaOptions *FormulaOptions,
) error
}
Update the formula text, and push that change to its destination There are two different implementations of this: 1. when WE own the repo, and 2. when we don't (often homebrew-core). The difference is that in case 2, we can't do a git pull -ff through the github API, so we need to clone and update
type FormulaOptions ¶
type FormulaOptions struct {
Name string // Descriptive name to be used for logging and general identification
FormulaName string // proper formula name without file extension
Path string // repo relative path with file extension
RepoOwner string // repo owner for Formula change
RepoName string // repo name for Formula change
PRRepoOwner string // optional, empty means use RepoOwner
PRRepoName string // optional, empty means use RepoName
PRBranch string // optional, default to master
PRDescription string
PRCommitName string
PRCommitEmail string
VersionRegex string
VersionShaRegex string
DarwinShaRegex string
LinuxShaRegex string
WindowsShaRegex string
// If true, open a PR even if this version is something other than a stable version. For example, "x.y.z-beta1"
// Note that per https://docs.brew.sh/Acceptable-Formulae#stable-versions, this is not allowed for homebrew-core
PublishUnstableVersion bool
DryRun bool
}
type FormulaStatus ¶
type GitClient ¶
type GitClient interface {
// a `ref string` is a fully qualified git ref name, like `refs/tags/1.3.0`
GetRefSha(ctx context.Context, owner string, repo string, ref string) (string, error)
GetReleaseAssetsByTag(ctx context.Context, owner, repo, version string) ([]ReleaseAsset, error)
// Optionally create a pull request. We may avoid opening the PR if dry run is enabled.
// This method will no-op and return nil if the version is a non-stable release version, and publishing non-stable versions has been disabled in the FormulaOptions
// Expects the version string without the leading "v"
CreatePullRequest(
ctx context.Context,
formulaOptions *FormulaOptions,
commitMessage string,
branchName string,
) error
}
look up git metadata; the source can be from GitHub
type PerPlatformSha256 ¶
type ReleaseAsset ¶
type RemoteShaGetter ¶
Click to show internal directories.
Click to hide internal directories.