Run consumer release commands through Go tools
This commit is contained in:
@@ -72,11 +72,14 @@ Then select a module and semantic version with the shared launcher:
|
||||
|
||||
The launcher copies the selected module's `go.mod` and `go.sum` to temporary
|
||||
alternate module files outside the checkout, resolves ReleaseKit from that
|
||||
module's local dependency selection, and builds the tool there. It invokes
|
||||
`publish` with the repository profile and `--expected-module` so the library
|
||||
can verify that the profile agrees with the selected table row. The temporary
|
||||
files and tool are removed on exit. As with any `publish` invocation, commit the
|
||||
selected module's release note and prepare its repository before publishing.
|
||||
module's local dependency selection, adds the CLI tool declaration to that
|
||||
temporary copy, and prepares its dependencies. It uses `go tool releasekit`
|
||||
with the alternate module file to invoke `publish` with the repository profile
|
||||
and `--expected-module` so the library can verify that the profile agrees with
|
||||
the selected table row. Go builds and caches the executable and preserves its
|
||||
exit status; the launcher removes the temporary metadata on exit. As with any
|
||||
`publish` invocation, commit the selected module's release note and prepare its
|
||||
repository before publishing.
|
||||
|
||||
If an integration depends on a sibling release, publish the dependency first,
|
||||
then publish the integration with the version that consumes it. For example,
|
||||
@@ -86,8 +89,9 @@ This declaration does not infer dependency order or rerun the standard suite.
|
||||
The maintained [Woodpecker example](woodpecker.yml) uses the same map and
|
||||
selector for root, `ckconfig`, and major-version tags. It verifies and detaches
|
||||
the literal event tag before selecting the module, copies that module's metadata
|
||||
outside the checkout, and builds the ReleaseKit version selected there. It then
|
||||
uses `ci-deliver --prepared` with the mapped profile and expected physical module.
|
||||
outside the checkout, and runs the ReleaseKit version selected there through
|
||||
`go tool releasekit`. It then uses `ci-deliver --prepared` with the mapped profile
|
||||
and expected physical module.
|
||||
The `core-v2` profile demonstrates binary delivery; the other profiles are
|
||||
page-only. Before enabling the workflow, configure each selected profile's
|
||||
`delivery` object with `"forge": "gitea"`, its `base_url`, owner, and repository,
|
||||
|
||||
@@ -37,12 +37,11 @@ releasekit_module=go.maximumdirect.net/releasekit
|
||||
export GOWORK=off
|
||||
export GOTOOLCHAIN=local
|
||||
go list -mod=mod -modfile="$bootstrap_dir/releasekit.mod" -m "$releasekit_module"
|
||||
go build -mod=mod -modfile="$bootstrap_dir/releasekit.mod" \
|
||||
-o "$bootstrap_dir/releasekit" "$releasekit_module/cmd/releasekit"
|
||||
go mod edit -modfile="$bootstrap_dir/releasekit.mod" -tool="$releasekit_module/cmd/releasekit"
|
||||
go list -mod=mod -modfile="$bootstrap_dir/releasekit.mod" -deps "$releasekit_module/cmd/releasekit" > /dev/null
|
||||
go tool -modfile="$bootstrap_dir/releasekit.mod" releasekit publish \
|
||||
--repo "$repository_dir" \
|
||||
--config "$profile_path" \
|
||||
--expected-module "$module_dir" \
|
||||
"$version"
|
||||
)
|
||||
|
||||
"$bootstrap_dir/releasekit" publish \
|
||||
--repo "$repository_dir" \
|
||||
--config "$profile_path" \
|
||||
--expected-module "$module_dir" \
|
||||
"$version"
|
||||
|
||||
@@ -40,14 +40,12 @@ steps:
|
||||
if [ "$${module_dir}" != . ]; then
|
||||
module_path="$${CI_WORKSPACE}/$${module_dir}"
|
||||
fi
|
||||
cp "$${module_path}/go.mod" "$${bootstrap_dir}/go.mod"
|
||||
cp "$${module_path}/go.mod" "$${bootstrap_dir}/releasekit.mod"
|
||||
if [ -f "$${module_path}/go.sum" ]; then
|
||||
cp "$${module_path}/go.sum" "$${bootstrap_dir}/go.sum"
|
||||
cp "$${module_path}/go.sum" "$${bootstrap_dir}/releasekit.sum"
|
||||
else
|
||||
: > "$${bootstrap_dir}/go.sum"
|
||||
: > "$${bootstrap_dir}/releasekit.sum"
|
||||
fi
|
||||
cp "$${bootstrap_dir}/go.mod" "$${bootstrap_dir}/releasekit.mod"
|
||||
cp "$${bootstrap_dir}/go.sum" "$${bootstrap_dir}/releasekit.sum"
|
||||
|
||||
export GOWORK=off
|
||||
export GOTOOLCHAIN=local
|
||||
@@ -55,13 +53,13 @@ steps:
|
||||
(
|
||||
cd "$${module_path}"
|
||||
go list -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" -m "$${releasekit_module}"
|
||||
go build -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" \
|
||||
-o "$${bootstrap_dir}/releasekit" "$${releasekit_module}/cmd/releasekit"
|
||||
go mod edit -modfile="$${bootstrap_dir}/releasekit.mod" -tool="$${releasekit_module}/cmd/releasekit"
|
||||
go list -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" -deps "$${releasekit_module}/cmd/releasekit" > /dev/null
|
||||
go tool -modfile="$${bootstrap_dir}/releasekit.mod" releasekit ci-deliver \
|
||||
--repo "$${CI_WORKSPACE}" \
|
||||
--config "$${profile_path}" \
|
||||
--expected-module "$${module_dir}" \
|
||||
--prepared \
|
||||
--commit "$${expected_commit}" \
|
||||
"$${CI_COMMIT_TAG}"
|
||||
)
|
||||
"$${bootstrap_dir}/releasekit" ci-deliver \
|
||||
--repo "$${CI_WORKSPACE}" \
|
||||
--config "$${profile_path}" \
|
||||
--expected-module "$${module_dir}" \
|
||||
--prepared \
|
||||
--commit "$${expected_commit}" \
|
||||
"$${CI_COMMIT_TAG}"
|
||||
|
||||
Reference in New Issue
Block a user