Skip to content

Commit

Permalink
feat(hack/build): mage release semver tools
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed Apr 6, 2023
1 parent ceb9c6d commit c63213f
Show file tree
Hide file tree
Showing 4 changed files with 261 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
env:
TAG: ${{ github.ref_name }}
run: |
if [[ $TAG == $(cat version.txt) ]]; then
if [[ $TAG == $(mage release:latest go.flipt.io/flipt) ]]; then
docker pull flipt/flipt:$TAG
skopeo copy --all docker://flipt/flipt:$TAG docker://flipt/flipt:latest
Expand Down
23 changes: 15 additions & 8 deletions hack/build/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,24 @@ func (t Test) Integration(ctx context.Context) error {

type Release mg.Namespace

func (r Release) Changelog(ctx context.Context, module, version string) error {
return release.PrepareChangelog(module, version)
func (r Release) Next(ctx context.Context, module, versionParts string) error {
return release.Next(module, versionParts)
}

func (r Release) Submodules(ctx context.Context, tag string) error {
client, err := daggerClient(ctx)
if err != nil {
return err
}
func (r Release) Latest(ctx context.Context, module string) error {
return release.Latest(module, false)
}

func (r Release) LatestRC(ctx context.Context, module string) error {
return release.Latest(module, true)
}

func (r Release) Changelog(ctx context.Context, module, version string) error {
return release.UpdateChangelog(module, version)
}

return release.Submodules(ctx, client, tag)
func (r Release) Tag(ctx context.Context, module, version string) error {
return release.Tag(ctx, module, version)
}

func daggerClient(ctx context.Context) (*dagger.Client, error) {
Expand Down
Loading

0 comments on commit c63213f

Please sign in to comment.