Skip to content

Commit

Permalink
internal/task: add a step to tag the release candidate
Browse files Browse the repository at this point in the history
For golang/vscode-go#3500

Change-Id: I257a974f06387a8888e96e645b3dd692e6ab6287
Reviewed-on: https://go-review.googlesource.com/c/build/+/612115
Auto-Submit: Hongxiang Jiang <hxjiang@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
  • Loading branch information
h9jiang authored and gopherbot committed Sep 11, 2024
1 parent b655b73 commit 6dd253a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions internal/task/releasevscodego.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ func (r *ReleaseVSCodeGoTasks) NewPrereleaseDefinition() *wf.Definition {

_ = wf.Task1(wd, "create release milestone and issue", r.createReleaseMilestoneAndIssue, release, wf.After(approved))

_ = wf.Action2(wd, "create release branch", r.createReleaseBranch, release, prerelease, wf.After(approved))
branched := wf.Action2(wd, "create release branch", r.createReleaseBranch, release, prerelease, wf.After(approved))
// TODO(hxjiang): replace empty commit with the branch's head once verified.
_ = wf.Action3(wd, "tag release candidate", r.tag, wf.Const(""), release, prerelease, wf.After(branched))

return wd
}
Expand Down Expand Up @@ -270,6 +272,15 @@ func (r *ReleaseVSCodeGoTasks) nextPrereleaseVersion(ctx *wf.TaskContext, releas
return fmt.Sprintf("rc.%v", pre+1), nil
}

func (r *ReleaseVSCodeGoTasks) tag(ctx *wf.TaskContext, commit string, release releaseVersion, prerelease string) error {
tag := fmt.Sprintf("%s-%s", release, prerelease)
if err := r.Gerrit.Tag(ctx, "vscode-go", tag, commit); err != nil {
return err
}
ctx.Printf("tagged commit %s with tag %s", commit, tag)
return nil
}

func isVSCodeGoStableVersion(release releaseVersion, _ string) bool {
return release.Minor%2 == 0
}
Expand Down Expand Up @@ -321,7 +332,7 @@ func latestVersion(versions []string, filters ...func(releaseVersion, string) bo
latestRelease := releaseVersion{}
latestPre := ""
for _, v := range versions {
release, prerelease, ok := parseVersion(v);
release, prerelease, ok := parseVersion(v)
if !ok {
continue
}
Expand Down

0 comments on commit 6dd253a

Please sign in to comment.