Build: Add github release command to build/cmd (#56349)

* Add github release command to build/cmd

* Use go-github library and implement dry-run

* Make tag optional and default to metadata

* Fix minor bug with tag default

* Make some refactors to ease testing

* Add tests for publish github command

* Refactor publish github tests

* Refactor test helper function name

* Isolate local test
This commit is contained in:
Guilherme Caulada
2022-10-20 11:11:53 -03:00
committed by GitHub
parent 4b68918b0b
commit 96a97f9827
5 changed files with 409 additions and 0 deletions

View File

@ -232,6 +232,32 @@ func main() {
},
},
},
{
Name: "github",
Usage: "Publish packages to GitHub releases",
Action: PublishGitHub,
Flags: []cli.Flag{
&dryRunFlag,
&cli.StringFlag{
Name: "path",
Required: true,
Usage: "Path to the asset to be published",
},
&cli.StringFlag{
Name: "repo",
Required: true,
Usage: "GitHub repository",
},
&cli.StringFlag{
Name: "tag",
Usage: "Release tag (default from metadata)ß",
},
&cli.BoolFlag{
Name: "create",
Usage: "Create release if it doesn't exist",
},
},
},
},
},
}