feat(release): add SDK release types and config converter
Add SDKRelease struct to hold SDK release results and toSDKConfig helper function to convert release.SDKConfig to sdk.Config. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
eaa35fb718
commit
e3d9aa2b90
1 changed files with 36 additions and 0 deletions
36
pkg/release/sdk.go
Normal file
36
pkg/release/sdk.go
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
// Package release provides release automation with changelog generation and publishing.
|
||||||
|
package release
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/host-uk/core/pkg/sdk"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SDKRelease holds the result of an SDK release.
|
||||||
|
type SDKRelease struct {
|
||||||
|
// Version is the SDK version.
|
||||||
|
Version string
|
||||||
|
// Languages that were generated.
|
||||||
|
Languages []string
|
||||||
|
// Output directory.
|
||||||
|
Output string
|
||||||
|
}
|
||||||
|
|
||||||
|
// toSDKConfig converts release.SDKConfig to sdk.Config.
|
||||||
|
func toSDKConfig(cfg *SDKConfig) *sdk.Config {
|
||||||
|
if cfg == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return &sdk.Config{
|
||||||
|
Spec: cfg.Spec,
|
||||||
|
Languages: cfg.Languages,
|
||||||
|
Output: cfg.Output,
|
||||||
|
Package: sdk.PackageConfig{
|
||||||
|
Name: cfg.Package.Name,
|
||||||
|
Version: cfg.Package.Version,
|
||||||
|
},
|
||||||
|
Diff: sdk.DiffConfig{
|
||||||
|
Enabled: cfg.Diff.Enabled,
|
||||||
|
FailOnBreaking: cfg.Diff.FailOnBreaking,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue