mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Release] 22.3.0 (#2842)
* [Release] 22.3.0 * Update version.h * Redirect stderr * Update should-release to filter non-master * Update should-release
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module should-release
|
||||
|
||||
go 1.19
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/google/go-github/v41 v41.0.0
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
@@ -59,6 +60,29 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
out, err := exec.Command("git", "rev-parse", "--abbrev-ref", "HEAD").Output()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
currentBranch := strings.TrimSpace(string(out))
|
||||
if currentBranch != "master" {
|
||||
fmt.Printf("Not on master, no need to release\n")
|
||||
fmt.Printf("Exiting code 78 to halt pipeline steps gracefully\n")
|
||||
os.Exit(78)
|
||||
}
|
||||
|
||||
if len(os.Getenv("RCLONE_FTP_PASS")) == 0 {
|
||||
fmt.Printf("Missing RCLONE_FTP_PASS no need to deploy\n")
|
||||
fmt.Printf("Exiting code 78 to halt pipeline steps gracefully\n")
|
||||
os.Exit(78)
|
||||
}
|
||||
|
||||
if len(os.Getenv("GH_RELEASE_GITHUB_API_TOKEN")) == 0 {
|
||||
fmt.Printf("Missing GH_RELEASE_GITHUB_API_TOKEN no need to deploy\n")
|
||||
fmt.Printf("Exiting code 78 to halt pipeline steps gracefully\n")
|
||||
os.Exit(78)
|
||||
}
|
||||
|
||||
if len(packageJsonFile) == 0 {
|
||||
fmt.Printf("Could not find package.json\n")
|
||||
os.Exit(1)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user