Skip to content

Commit

Permalink
fix(go/tools/release): fix urls to use bazel-contrib (#4178)
Browse files Browse the repository at this point in the history
These need to be updated since the repository was moved to the
@bazel-contrib/rules-authors org
  • Loading branch information
tyler-french authored Nov 22, 2024
1 parent 5c06cb2 commit a985583
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions go/tools/releaser/boilerplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ http_archive(
name = "io_bazel_rules_go",
sha256 = "%[2]s",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/%[1]s/rules_go-%[1]s.zip",
"https://github.com/bazelbuild/rules_go/releases/download/%[1]s/rules_go-%[1]s.zip",
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/%[1]s/rules_go-%[1]s.zip",
"https://github.com/bazel-contrib/rules_go/releases/download/%[1]s/rules_go-%[1]s.zip",
],
)
Expand Down
12 changes: 6 additions & 6 deletions go/tools/releaser/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func runPrepare(ctx context.Context, stderr io.Writer, args []string) error {

// Get the GitHub release.
fmt.Fprintf(stderr, "checking if release %s exists...\n", version)
release, err := gh.getReleaseByTagIncludingDraft(ctx, "bazelbuild", "rules_go", version)
release, err := gh.getReleaseByTagIncludingDraft(ctx, "bazel-contrib", "rules_go", version)
if err != nil && !errors.Is(err, errReleaseNotFound) {
return err
}
Expand Down Expand Up @@ -181,7 +181,7 @@ func runPrepare(ctx context.Context, stderr io.Writer, args []string) error {
}

// Upload to mirror.bazel.build.
arcGHURLWithoutScheme := fmt.Sprintf("github.com/bazelbuild/rules_go/releases/download/%[1]s/rules_go-%[1]s.zip", version)
arcGHURLWithoutScheme := fmt.Sprintf("github.com/bazel-contrib/rules_go/releases/download/%[1]s/rules_go-%[1]s.zip", version)
if uploadToMirror {
fmt.Fprintf(stderr, "uploading archive to mirror.bazel.build...\n")
if err := copyFileToMirror(ctx, arcGHURLWithoutScheme, arcName); err != nil {
Expand All @@ -200,17 +200,17 @@ func runPrepare(ctx context.Context, stderr io.Writer, args []string) error {
Body: &rnotesStr,
Draft: &draft,
}
if release, _, err = gh.Repositories.CreateRelease(ctx, "bazelbuild", "rules_go", release); err != nil {
if release, _, err = gh.Repositories.CreateRelease(ctx, "bazel-contrib", "rules_go", release); err != nil {
return err
}
} else {
fmt.Fprintf(stderr, "updating release...\n")
release.Body = &rnotesStr
if release, _, err = gh.Repositories.EditRelease(ctx, "bazelbuild", "rules_go", release.GetID(), release); err != nil {
if release, _, err = gh.Repositories.EditRelease(ctx, "bazel-contrib", "rules_go", release.GetID(), release); err != nil {
return err
}
for _, asset := range release.Assets {
if _, err := gh.Repositories.DeleteReleaseAsset(ctx, "bazelbuild", "rules_go", asset.GetID()); err != nil {
if _, err := gh.Repositories.DeleteReleaseAsset(ctx, "bazel-contrib", "rules_go", asset.GetID()); err != nil {
return err
}
}
Expand All @@ -224,7 +224,7 @@ func runPrepare(ctx context.Context, stderr io.Writer, args []string) error {
Name: "rules_go-" + version + ".zip",
MediaType: "application/zip",
}
if _, _, err := gh.Repositories.UploadReleaseAsset(ctx, "bazelbuild", "rules_go", release.GetID(), uploadOpts, arcFile); err != nil {
if _, _, err := gh.Repositories.UploadReleaseAsset(ctx, "bazel-contrib", "rules_go", release.GetID(), uploadOpts, arcFile); err != nil {
return err
}

Expand Down

0 comments on commit a985583

Please sign in to comment.