Documentation
¶
Overview ¶
Package releasecheck decides whether a pushed tag may become a tanGO release. The release workflow runs it (see cmd/releasecheck) and creates the GitHub release only when it passes; RELEASING.md describes the whole process.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RequiredJobs = []string{"lint", "test (sqlite)", "test (postgres)"}
RequiredJobs are the CI jobs that must all succeed on the exact commit a release tags.
Functions ¶
Types ¶
type CIJob ¶
CIJob is one job of a CIRun.
func (*CIJob) UnmarshalJSON ¶
CIJob decodes from the GitHub API's job objects.
type CIRun ¶
type CIRun struct {
Status string // queued, in_progress, completed, ...
Conclusion string // success, failure, ... once completed
Jobs []CIJob
}
CIRun is one CI workflow run and its jobs.
type Live ¶
type Live struct {
Dir string // the git checkout, with main fetched as origin/main
Repo string // owner/name on GitHub
Module string // the module path, e.g. github.com/angvp/tango
Token string // a GitHub token that can read Actions runs
Client *http.Client // nil means http.DefaultClient
API string // "" means https://api.github.com
Proxy string // "" means https://proxy.golang.org
}
Live looks things up in the git checkout, the GitHub Actions API and the Go module proxy.
func (Live) CIRuns ¶
CIRuns returns the CI workflow's runs for commit, each with the jobs of its latest attempt.
type Release ¶
type Release struct {
Tag string // the pushed tag, e.g. v0.1.1
Commit string // the full SHA the tag points to
Changelog []byte // CHANGELOG.md at that commit
// Gorelease is gorelease's report comparing the tagged commit with the
// previous release, or "" if it wasn't run.
Gorelease string
}
Release is a pushed tag and what the workflow gathered about it.
type Sources ¶
type Sources interface {
// OnMain reports whether commit is reachable from main.
OnMain(ctx context.Context, commit string) (bool, error)
// CIRuns returns every CI workflow run for exactly commit.
CIRuns(ctx context.Context, commit string) ([]CIRun, error)
// PublishedCommit returns the commit the Go module proxy already serves
// for tag, or "" if it doesn't know the tag.
PublishedCommit(ctx context.Context, tag string) (string, error)
}
Sources looks up what the tag alone doesn't say.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
releasecheck
command
Command releasecheck decides whether a pushed tag may become a tanGO release, and writes its release notes.
|
Command releasecheck decides whether a pushed tag may become a tanGO release, and writes its release notes. |