Support full-tag prepared CI delivery

This commit is contained in:
2026-10-10 03:40:10 +00:00
parent f837871b77
commit c0cc50b127
11 changed files with 272 additions and 55 deletions

View File

@@ -10,26 +10,29 @@ import (
"gitea.maximumdirect.net/eric/ReleaseKit/internal/releaseidentity"
)
// TaggedCheckoutRequest selects a stable tag and the full Git object ID
// expected by an external build or CI event. An empty Remote selects origin.
// TaggedCheckoutRequest selects a full Git tag and the Git object ID expected
// by an external build or CI event. An empty Remote selects origin.
type TaggedCheckoutRequest struct {
RepositoryDir string
Version string
Tag string
Remote string
ExpectedCommit string
// VerifyOnly checks an already prepared checkout without fetching or checking out.
VerifyOnly bool
}
// PrepareTaggedCheckout fetches Version from Remote, verifies that its peeled
// commit matches ExpectedCommit, and checks out that commit detached. This
// operation mutates the selected local repository; use it for disposable
// checkouts where tag-fetch and checkout conflicts can be resolved by the
// caller. It does not publish a tag or hosted content.
// PrepareTaggedCheckout fetches Tag from Remote, verifies that its peeled
// commit matches ExpectedCommit, and checks out that commit detached. When
// VerifyOnly is true, it performs the same tag, HEAD, and cleanliness checks
// without fetching or changing the checkout. It does not publish a tag or
// hosted content.
func PrepareTaggedCheckout(ctx context.Context, request TaggedCheckoutRequest) error {
return internalpreparation.PrepareTaggedCheckout(ctx, internalpreparation.TaggedCheckoutRequest{
RepositoryDir: request.RepositoryDir,
Version: request.Version,
Tag: request.Tag,
Remote: request.Remote,
ExpectedCommit: request.ExpectedCommit,
VerifyOnly: request.VerifyOnly,
})
}