mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-08 21:39:53 +00:00
ci: explicitly disable CGO
This commit is contained in:
parent
7307eea2a8
commit
f95a31120d
28
hyperbole.py
28
hyperbole.py
@ -74,8 +74,7 @@ def get_app_commit():
|
|||||||
if not app_commit:
|
if not app_commit:
|
||||||
try:
|
try:
|
||||||
app_commit = (
|
app_commit = (
|
||||||
subprocess.check_output(
|
subprocess.check_output(["git", "rev-parse", "HEAD"]).decode().strip()
|
||||||
["git", "rev-parse", "HEAD"]).decode().strip()
|
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
app_commit = "Unknown"
|
app_commit = "Unknown"
|
||||||
@ -86,8 +85,7 @@ def get_app_platforms():
|
|||||||
platforms = os.environ.get("HY_APP_PLATFORMS")
|
platforms = os.environ.get("HY_APP_PLATFORMS")
|
||||||
if not platforms:
|
if not platforms:
|
||||||
d_os = subprocess.check_output(["go", "env", "GOOS"]).decode().strip()
|
d_os = subprocess.check_output(["go", "env", "GOOS"]).decode().strip()
|
||||||
d_arch = subprocess.check_output(
|
d_arch = subprocess.check_output(["go", "env", "GOARCH"]).decode().strip()
|
||||||
["go", "env", "GOARCH"]).decode().strip()
|
|
||||||
return [(d_os, d_arch)]
|
return [(d_os, d_arch)]
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
@ -118,8 +116,10 @@ def cmd_build(pprof=False, release=False):
|
|||||||
"-X",
|
"-X",
|
||||||
APP_SRC_CMD_PKG + ".appDate=" + app_date,
|
APP_SRC_CMD_PKG + ".appDate=" + app_date,
|
||||||
"-X",
|
"-X",
|
||||||
APP_SRC_CMD_PKG + ".appType=" +
|
APP_SRC_CMD_PKG
|
||||||
("release" if release else "dev") + ("-pprof" if pprof else ""),
|
+ ".appType="
|
||||||
|
+ ("release" if release else "dev")
|
||||||
|
+ ("-pprof" if pprof else ""),
|
||||||
"-X",
|
"-X",
|
||||||
APP_SRC_CMD_PKG + ".appCommit=" + app_commit,
|
APP_SRC_CMD_PKG + ".appCommit=" + app_commit,
|
||||||
]
|
]
|
||||||
@ -135,6 +135,7 @@ def cmd_build(pprof=False, release=False):
|
|||||||
out_name += ".exe"
|
out_name += ".exe"
|
||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
|
env["CGO_ENABLED"] = "0"
|
||||||
env["GOOS"] = os_name
|
env["GOOS"] = os_name
|
||||||
env["GOARCH"] = arch
|
env["GOARCH"] = arch
|
||||||
|
|
||||||
@ -240,16 +241,19 @@ def main():
|
|||||||
|
|
||||||
# Run
|
# Run
|
||||||
p_run = p_cmd.add_parser("run", help="Run the app")
|
p_run = p_cmd.add_parser("run", help="Run the app")
|
||||||
p_run.add_argument("-p", "--pprof", action="store_true",
|
p_run.add_argument(
|
||||||
help="Run with pprof enabled")
|
"-p", "--pprof", action="store_true", help="Run with pprof enabled"
|
||||||
|
)
|
||||||
p_run.add_argument("args", nargs=argparse.REMAINDER)
|
p_run.add_argument("args", nargs=argparse.REMAINDER)
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
p_build = p_cmd.add_parser("build", help="Build the app")
|
p_build = p_cmd.add_parser("build", help="Build the app")
|
||||||
p_build.add_argument("-p", "--pprof", action="store_true",
|
p_build.add_argument(
|
||||||
help="Build with pprof enabled")
|
"-p", "--pprof", action="store_true", help="Build with pprof enabled"
|
||||||
p_build.add_argument("-r", "--release", action="store_true",
|
)
|
||||||
help="Build a release version")
|
p_build.add_argument(
|
||||||
|
"-r", "--release", action="store_true", help="Build a release version"
|
||||||
|
)
|
||||||
|
|
||||||
# Format
|
# Format
|
||||||
p_cmd.add_parser("format", help="Format the code")
|
p_cmd.add_parser("format", help="Format the code")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user