Skip to content

Commit f4f4da2

Browse files
committed
fix version
1 parent caad442 commit f4f4da2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/gonyx/hatch_build.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class CustomBuildHook(BuildHookInterface):
1212
"""Build hook to compile the Go binary and include it in the wheel."""
1313

14-
def initialize(self, version: Any, build_data: Any) -> None:
14+
def initialize(self, version: Any, build_data: Any) -> None: # noqa: ARG002
1515
"""Build the Go binary before packaging."""
1616
build_data["pure_python"] = False
1717

@@ -25,6 +25,7 @@ def initialize(self, version: Any, build_data: Any) -> None:
2525

2626
# Get config and environment
2727
binary_name = self.config.get("binary_name", "gonyx")
28+
tag = os.getenv("GITHUB_REF_NAME", "dev").lstrip(f"{binary_name}/")
2829
commit = os.getenv("GITHUB_SHA", "none")
2930

3031
# Build the Go binary if it doesn't exist
@@ -34,7 +35,7 @@ def initialize(self, version: Any, build_data: Any) -> None:
3435
[
3536
"go",
3637
"build",
37-
f"-ldflags=-X main.version={version} -X main.commit={commit} -s -w",
38+
f"-ldflags=-X main.version={tag} -X main.commit={commit} -s -w",
3839
"-o",
3940
binary_name,
4041
],

0 commit comments

Comments
 (0)