Skip to content

v0.x: the static release channel

Spec 0203 adds a second release channel for self-updating tools and withdraws the direct channel the generator carried under spec 0195 D7.

What changed

  • A new channel. release_source.type: static with release_source.static.base_url makes a tool read its releases from a pointer (<base>/latest.json) and per-tag manifests (<base>/<tag>/release.json) at any https location, with no forge involved. The generator offers it on the self-update page and as --release-channel static --release-base-url <url>; a project generated with --no-forge can self-update this way, which it could not before. The forge stays the default for a hosted project.
  • The direct channel is gone from the generator. --release-channel direct and the seven --release-* template flags are refused or removed. release_source.direct.* in an existing manifest still loads, and the first regenerate drops the block and says so in its log. release_source.type: direct is refused with a message naming the replacement. No project was ever generated with a working direct channel, so nothing is migrated from it. The framework's own props.ReleaseSource{Type: "direct"} through go/forge's direct provider is unaffected: this note is about what the generator writes.
  • props.ReleaseSource gains BaseURL and the constant props.ReleaseSourceStatic.
  • gtb updates from the static channel. gtb update reads https://pkg.phpboyscout.uk/go-tool-base/latest.json and no longer consults GitLab. A gtb installed before this change still updates through the GitLab release's asset links, which point at the same store.

Moving a project to the static channel

  1. Record the location, then the type, so validation never sees a static type without its URL:

    gtb set release_source.static.base_url https://pkg.example.org/acme/mytool
    gtb set release_source.type static
    

    Or regenerate with --release-channel static --release-base-url <url>.

  2. The regenerate that follows renders the tool's release source as the type and the base URL, adds before_publish, blobs and publishers to .goreleaser.yaml, ships scripts/move-pointer.sh, adds the go tool releasemanifest directive to go.mod, and sets the GitLab pipeline's goreleaser component to pro: true.

  3. Give the pipeline what the release configuration reads: GORELEASER_KEY, RELEASE_STORE_ENDPOINT, RELEASE_STORE_BUCKET and the store's AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY. See Secure releases.
  4. The first release on the channel starts the chain (previous is empty) and creates the pointer. Installed copies of the previous release update through the forge as before; from the next release on they read the pointer.

An estate tool follows the same steps; the store's base URL is https://pkg.phpboyscout.uk/<project path>.

Leaving it

Set release_source.type back to the forge and regenerate: the three goreleaser pieces, the pointer script and the tool directive go, and a base URL left behind is ignored with a warning until it is cleared.