Invoke the registered ReleaseKit package explicitly
This commit is contained in:
@@ -34,16 +34,17 @@ Go minimum. See the
|
||||
|
||||
### Select the Go host target
|
||||
|
||||
Run `go tool releasekit` from within the consumer module to use its selected
|
||||
version. Go builds and caches the executable and preserves its exit status.
|
||||
A launcher invoked from that module can forward commands directly:
|
||||
Invoke the ReleaseKit tool by its full package path from within the consumer
|
||||
module to use its selected version. Go builds and caches the executable and
|
||||
preserves its exit status. The full path distinguishes tools with the same
|
||||
short name. A launcher can forward commands directly:
|
||||
|
||||
```sh
|
||||
#!/bin/sh
|
||||
releasekit_host_os=$(go env GOHOSTOS) || exit $?
|
||||
releasekit_host_arch=$(go env GOHOSTARCH) || exit $?
|
||||
export GOOS="$releasekit_host_os" GOARCH="$releasekit_host_arch"
|
||||
exec go tool releasekit "$@"
|
||||
exec go tool go.maximumdirect.net/releasekit/cmd/releasekit "$@"
|
||||
```
|
||||
|
||||
Save this launcher as `releasekit` and run `sh ./releasekit version` from the
|
||||
@@ -114,9 +115,9 @@ Go module identity. The Go consumer minimum remains 1.26.0.
|
||||
## CI adoption
|
||||
|
||||
The maintained [consumer tag-delivery workflow](delivery.md#woodpecker-tag-workflows)
|
||||
supports both tool and ordinary package dependencies. It runs `go tool releasekit`
|
||||
with temporary module metadata derived from the tagged consumer's module
|
||||
selection, so the committed module files also govern CI delivery and retries.
|
||||
supports both tool and ordinary package dependencies. It runs the ReleaseKit
|
||||
tool by its full package path with temporary metadata derived from the tagged
|
||||
module, so the committed module files also govern CI delivery and retries.
|
||||
Registering the CLI as a tool is sufficient for
|
||||
consumers that use ReleaseKit only for maintainer commands.
|
||||
|
||||
|
||||
@@ -296,9 +296,10 @@ directory outside the checkout. `go list -m` confirms that the module selects
|
||||
ReleaseKit. The template selects the host Go target before preparing and running
|
||||
the CLI. The template adds its CLI tool declaration to that temporary copy
|
||||
and prepares tool dependencies with `go list -deps`. It then uses
|
||||
`go tool -modfile=... releasekit` to build, cache, and run the selected tool with
|
||||
`CI_WORKSPACE`, the resolved event commit, and `CI_COMMIT_TAG`. The tagged module
|
||||
files stay unchanged, including for consumers with an ordinary package
|
||||
`go tool -modfile=... go.maximumdirect.net/releasekit/cmd/releasekit` to build,
|
||||
cache, and run the selected tool with `CI_WORKSPACE`, the resolved event commit,
|
||||
and `CI_COMMIT_TAG`. The tagged module files stay unchanged, including for
|
||||
consumers with an ordinary package
|
||||
dependency. A cleanup trap removes the temporary metadata; Go manages the
|
||||
cached executable. The command preserves the tool's exit status.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user