Skip to content

Commit afc872b

Browse files
committed
Update release script to open GitHub PR link instead of creating release
- Remove GitHub release creation (handled by GitHub Actions) - Add browser opening functionality to open PR creation page - Update success message to reflect that only branch and tag are created - Script now only creates release branch, tag, and pushes them - Opens browser to GitHub PR creation page for convenience
1 parent 99245fe commit afc872b

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

scripts/make-release.go

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os/exec"
88
"path/filepath"
99
"regexp"
10+
"runtime"
1011
"sort"
1112
"strconv"
1213
"strings"
@@ -382,21 +383,25 @@ func pushBranchAndTag(branch, tag string) error {
382383
func showSuccessMessage(releaseBranch, defaultBranch, tag string) {
383384
fmt.Println()
384385
green.Println("════════════════════════════════════════")
385-
green.Println(" Release PR Created Successfully!")
386+
green.Println(" Release Branch and Tag Created Successfully!")
386387
green.Println("════════════════════════════════════════")
387388
fmt.Println()
388389

389-
cyan.Println("📋 Next steps:")
390-
fmt.Println(" 1. GitHub Actions will automatically build the release when the tag is pushed.")
391-
fmt.Println(" 2. Create a pull request:")
392-
393390
// Get repository URL
394391
repoURL, err := getRepositoryURL()
392+
prURL := ""
395393
if err == nil {
394+
prURL = fmt.Sprintf("https://github.com/%s/compare/%s...%s", repoURL, defaultBranch, releaseBranch)
395+
cyan.Println("📋 Next steps:")
396+
fmt.Println(" 1. GitHub Actions will automatically build the release when the tag is pushed.")
397+
fmt.Println(" 2. Create a pull request:")
396398
fmt.Printf(" - Source: %s\n", releaseBranch)
397399
fmt.Printf(" - Target: %s\n", defaultBranch)
398-
fmt.Printf(" - URL: https://github.com/%s/compare/%s...%s\n", repoURL, defaultBranch, releaseBranch)
400+
fmt.Printf(" - URL: %s\n", prURL)
399401
} else {
402+
cyan.Println("📋 Next steps:")
403+
fmt.Println(" 1. GitHub Actions will automatically build the release when the tag is pushed.")
404+
fmt.Println(" 2. Create a pull request:")
400405
fmt.Printf(" - Source: %s\n", releaseBranch)
401406
fmt.Printf(" - Target: %s\n", defaultBranch)
402407
}
@@ -405,13 +410,39 @@ func showSuccessMessage(releaseBranch, defaultBranch, tag string) {
405410
fmt.Printf(" 4. Review and merge the PR into %s to complete the release.\n", defaultBranch)
406411
fmt.Println()
407412

413+
// Open browser to PR creation page
414+
if prURL != "" {
415+
cyan.Println("🌐 Opening GitHub PR creation page...")
416+
if err := openBrowser(prURL); err != nil {
417+
yellow.Printf("⚠ Could not open browser automatically. Please visit: %s\n", prURL)
418+
} else {
419+
green.Println("✓ Browser opened.")
420+
}
421+
fmt.Println()
422+
}
423+
408424
// Suggest switching back to original branch
409425
if originalBranch != "" && originalBranch != releaseBranch {
410426
yellow.Printf("💡 To switch back to your previous branch, run:\n")
411427
fmt.Printf(" git checkout %s\n", originalBranch)
412428
}
413429
}
414430

431+
func openBrowser(url string) error {
432+
var cmd *exec.Cmd
433+
switch runtime.GOOS {
434+
case "windows":
435+
cmd = exec.Command("cmd", "/c", "start", url)
436+
case "darwin":
437+
cmd = exec.Command("open", url)
438+
case "linux":
439+
cmd = exec.Command("xdg-open", url)
440+
default:
441+
return fmt.Errorf("unsupported platform")
442+
}
443+
return cmd.Run()
444+
}
445+
415446
func getRepositoryURL() (string, error) {
416447
output, err := runGitCommandOutput("config", "--get", "remote.origin.url")
417448
if err != nil {

0 commit comments

Comments
 (0)