✨ Release runner
This commit is contained in:
parent
9b4979af39
commit
5c24b4f547
@ -19,6 +19,7 @@ type ProductRelease struct {
|
|||||||
Type ProductReleaseType `json:"type"`
|
Type ProductReleaseType `json:"type"`
|
||||||
Channel string `json:"channel"`
|
Channel string `json:"channel"`
|
||||||
Assets datatypes.JSONType[map[string]ReleaseAsset] `json:"assets"`
|
Assets datatypes.JSONType[map[string]ReleaseAsset] `json:"assets"`
|
||||||
|
Runners datatypes.JSONType[map[string]ReleaseRunner] `json:"runner"`
|
||||||
Installers datatypes.JSONType[map[string]ReleaseInstaller] `json:"installers"`
|
Installers datatypes.JSONType[map[string]ReleaseInstaller] `json:"installers"`
|
||||||
|
|
||||||
ProductID uint `json:"product_id"`
|
ProductID uint `json:"product_id"`
|
||||||
@ -50,3 +51,9 @@ type ReleaseInstallerPatch struct {
|
|||||||
Action string `json:"action" validate:"required"`
|
Action string `json:"action" validate:"required"`
|
||||||
Glob string `json:"glob" validate:"required"`
|
Glob string `json:"glob" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ReleaseRunner struct {
|
||||||
|
Workdir string `json:"workdir"`
|
||||||
|
Script string `json:"script"`
|
||||||
|
Label string `json:"label"`
|
||||||
|
}
|
||||||
|
@ -58,6 +58,7 @@ func createRelease(c *fiber.Ctx) error {
|
|||||||
Content string `json:"content" validate:"required"`
|
Content string `json:"content" validate:"required"`
|
||||||
Assets map[string]models.ReleaseAsset `json:"assets" validate:"required"`
|
Assets map[string]models.ReleaseAsset `json:"assets" validate:"required"`
|
||||||
Installers map[string]models.ReleaseInstaller `json:"installers" validate:"required"`
|
Installers map[string]models.ReleaseInstaller `json:"installers" validate:"required"`
|
||||||
|
Runners map[string]models.ReleaseRunner `json:"runners" validate:"required"`
|
||||||
Attachments []string `json:"attachments"`
|
Attachments []string `json:"attachments"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,6 +77,7 @@ func createRelease(c *fiber.Ctx) error {
|
|||||||
Channel: data.Channel,
|
Channel: data.Channel,
|
||||||
Assets: datatypes.NewJSONType(data.Assets),
|
Assets: datatypes.NewJSONType(data.Assets),
|
||||||
Installers: datatypes.NewJSONType(data.Installers),
|
Installers: datatypes.NewJSONType(data.Installers),
|
||||||
|
Runners: datatypes.NewJSONType(data.Runners),
|
||||||
ProductID: product.ID,
|
ProductID: product.ID,
|
||||||
Meta: models.ProductReleaseMeta{
|
Meta: models.ProductReleaseMeta{
|
||||||
Title: data.Title,
|
Title: data.Title,
|
||||||
@ -110,6 +112,7 @@ func updateRelease(c *fiber.Ctx) error {
|
|||||||
Content string `json:"content" validate:"required"`
|
Content string `json:"content" validate:"required"`
|
||||||
Assets map[string]models.ReleaseAsset `json:"assets" validate:"required"`
|
Assets map[string]models.ReleaseAsset `json:"assets" validate:"required"`
|
||||||
Installers map[string]models.ReleaseInstaller `json:"installers" validate:"required"`
|
Installers map[string]models.ReleaseInstaller `json:"installers" validate:"required"`
|
||||||
|
Runners map[string]models.ReleaseRunner `json:"runners" validate:"required"`
|
||||||
Attachments []string `json:"attachments"`
|
Attachments []string `json:"attachments"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +135,7 @@ func updateRelease(c *fiber.Ctx) error {
|
|||||||
release.Channel = data.Channel
|
release.Channel = data.Channel
|
||||||
release.Assets = datatypes.NewJSONType(data.Assets)
|
release.Assets = datatypes.NewJSONType(data.Assets)
|
||||||
release.Installers = datatypes.NewJSONType(data.Installers)
|
release.Installers = datatypes.NewJSONType(data.Installers)
|
||||||
|
release.Runners = datatypes.NewJSONType(data.Runners)
|
||||||
release.Meta.Title = data.Title
|
release.Meta.Title = data.Title
|
||||||
release.Meta.Description = data.Description
|
release.Meta.Description = data.Description
|
||||||
release.Meta.Content = data.Content
|
release.Meta.Content = data.Content
|
||||||
|
Loading…
x
Reference in New Issue
Block a user