Documentation
¶
Index ¶
- type Client
- type Platform
- func (p *Platform) Check() error
- func (p *Platform) CheckAssets() error
- func (p *Platform) CreateRelease(ctx context.Context, tag, notes string, prerelease bool) error
- func (p *Platform) HasAssets() bool
- func (p *Platform) LinkContext() port.LinkContext
- func (p *Platform) Name() string
- func (p *Platform) ReleaseURL(tag string) string
- func (p *Platform) ReleaseURLFromContext(tag string, lc *port.LinkContext) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.82.0
type Client struct {
// contains filtered or unexported fields
}
Client publishes GitHub releases over the REST API through go-github (ADR-0077).
func NewClient ¶ added in v0.82.0
NewClient builds a client for repository ("owner/repo") on the GitHub instance whose web root is baseURL (empty means github.com). The API root comes from config.GitHubAPIURL, which reads GITHUB_API_URL through getenv in GitHub Actions.
func (*Client) CreateRelease ¶ added in v0.82.0
func (c *Client) CreateRelease(ctx context.Context, tag, notes string, draft, prerelease bool, assets []platforms.Asset) ([]string, error)
CreateRelease publishes the release for tag and returns the names GitHub gave the uploaded assets, which can differ from the file names (GitHub rewrites special characters). Without assets it is one create call. With assets the release is created as a draft, each file is uploaded, then the draft is published unless draft is set: uploading to a published release fails when immutable releases are on. If an upload or the publish fails, the draft is deleted so a re-run starts clean; a failed delete is appended to the original error. ctx stops the requests (Ctrl-C); the delete runs on its own short context, so it still happens once ctx is cancelled.
func (*Client) VerifyReleasesAccess ¶ added in v0.82.0
VerifyReleasesAccess checks that the token can read the repository's releases.
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
Platform implements port.Platform for GitHub over the REST API (ADR-0077).
func (*Platform) Check ¶
Check verifies a token is available, the repository is resolvable, and the token can read the repository's releases.
func (*Platform) CheckAssets ¶ added in v0.81.0
CheckAssets applies the asset rules (confinement to the repository, and every pattern matching a file unless release.allow_missing_assets is set) ahead of publishing, and refuses two files GitHub would publish under one name: it renames special characters and compares names without case.
func (*Platform) CreateRelease ¶
CreateRelease publishes the release through the REST API (Client.CreateRelease). Asset globs resolve leniently: the tag is already pushed by now, so a pattern matching nothing warns and is skipped rather than failing the release. Each asset is opened once and uploaded from that descriptor (NEW-002), and a name GitHub rewrites is reported. prerelease is derived by the caller from the resolved version (ADR-0064), not read from config.
func (*Platform) LinkContext ¶ added in v0.24.0
func (p *Platform) LinkContext() port.LinkContext
LinkContext resolves this platform's link coordinates. GitHub repositories are owner/repo, so the path splits on the first slash. BaseURL falls back to the default host when unset (e.g. a config that was not run through the loader's normalize step).
func (*Platform) ReleaseURL ¶
func (*Platform) ReleaseURLFromContext ¶ added in v0.36.5
func (p *Platform) ReleaseURLFromContext(tag string, lc *port.LinkContext) string
ReleaseURLFromContext builds the release URL from a pre-resolved link context so the displayed URL stays consistent with the one used to generate release notes (ADR-0022). Ambient contexts carry the full project URL in BaseURL (Owner/Repo empty); platform contexts carry the host in BaseURL with Owner and Repo set separately.