mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-03 20:07:36 +03:00
release: Fix check prerelease
This commit is contained in:
parent
dd9de694f8
commit
483d9fa503
3 changed files with 9 additions and 38 deletions
|
@ -36,11 +36,3 @@ func ReadTagVersion() (badversion.Version, error) {
|
|||
}
|
||||
return version, nil
|
||||
}
|
||||
|
||||
func IsDevBranch() bool {
|
||||
branch, err := shell.Exec("git", "branch", "--show-current").ReadOutput()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return branch == "dev-next"
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
|
||||
"github.com/sagernet/sing-box/cmd/internal/build_shared"
|
||||
"github.com/sagernet/sing-box/log"
|
||||
F "github.com/sagernet/sing/common/format"
|
||||
)
|
||||
|
||||
var nightly bool
|
||||
|
@ -22,25 +21,14 @@ func main() {
|
|||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
var (
|
||||
versionStr string
|
||||
isPrerelease bool
|
||||
)
|
||||
var versionStr string
|
||||
if version.PreReleaseIdentifier != "" {
|
||||
isPrerelease = true
|
||||
versionStr = version.VersionString() + "-nightly"
|
||||
} else {
|
||||
version.Patch++
|
||||
versionStr = version.VersionString() + "-nightly"
|
||||
}
|
||||
if build_shared.IsDevBranch() {
|
||||
isPrerelease = true
|
||||
}
|
||||
err = setGitHubOutput("version", versionStr)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = setGitHubOutput("prerelease", F.ToString(isPrerelease))
|
||||
err = setGitHubEnv("version", versionStr)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@ -55,7 +43,7 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
func setGitHubOutput(name string, value string) error {
|
||||
func setGitHubEnv(name string, value string) error {
|
||||
outputFile, err := os.OpenFile(os.Getenv("GITHUB_ENV"), os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o644)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue