feat: tag recipes with abra #99

Merged
decentral1se merged 5 commits from knoflook/abra:recipe-release into main 2021-09-29 12:39:36 +00:00
Showing only changes of commit 9faefd2592 - Show all commits

View File

@ -17,6 +17,13 @@ import (
"github.com/urfave/cli/v2"
)
var Push bool
var PushFlag = &cli.BoolFlag{
Name: "push",
Value: false,
Destination: &Push,
}
var Dry bool
var DryFlag = &cli.BoolFlag{
Name: "dry-run",
@ -59,6 +66,7 @@ var recipeReleaseCommand = &cli.Command{
PatchFlag,
MinorFlag,
MajorFlag,
PushFlag,
knoflook marked this conversation as resolved Outdated

(from recipe.EnsureVersion)

repo, err := git.PlainOpen(directory)
if err != nil {
    return err
}

tags, err := repo.Tags()
if err != nil {
    return nil
}
(from `recipe.EnsureVersion`) ```golang repo, err := git.PlainOpen(directory) if err != nil { return err } tags, err := repo.Tags() if err != nil { return nil } ```
},
Action: func(c *cli.Context) error {
recipe := internal.ValidateRecipe(c)
@ -85,6 +93,12 @@ var recipeReleaseCommand = &cli.Command{
Message: tag,
})*/
logrus.Info(fmt.Sprintf("Created tag %s at %s.", tagstring, head.Hash()))
if Push {
if err := repo.Push(&git.PushOptions{}); err != nil {
logrus.Fatal(err)
}
logrus.Info(fmt.Sprintf("Pushed tag %s to remote.", tagstring))
}
return nil
}
@ -164,6 +178,12 @@ var recipeReleaseCommand = &cli.Command{
Message: tag,
})*/
logrus.Info(fmt.Sprintf("Created tag %s at %s.", newTagString, head.Hash()))
if Push {
if err := repo.Push(&git.PushOptions{}); err != nil {
logrus.Fatal(err)
}
logrus.Info(fmt.Sprintf("Pushed tag %s to remote.", newTagString))
}
return nil