tenseleyflow/shithub / 0b7d10d

Browse files

fix(deploy): build via make so version/commit/builtAt land in the binary

Authored by espadonne
SHA
0b7d10d0bb9fcbc1d0eedbccffb1820d8de689b1
Parents
f121117
Tree
9ca7135

1 changed file

StatusFile+-
M .github/workflows/deploy.yml 10 4
.github/workflows/deploy.ymlmodified
@@ -46,12 +46,18 @@ jobs:
4646
           go-version-file: go.mod
4747
           cache: true
4848
 
49
-      - name: Build shithubd for linux/amd64
49
+      # Delegate to `make build` so the version-injection ldflags
50
+      # (Version/Commit/BuiltAt → internal/version) are the same set
51
+      # the local Makefile uses. The previous inline `go build` here
52
+      # passed only `-s -w`, which left the homepage stamps showing
53
+      # "dev (unknown, built unknown)" on every deployed binary.
54
+      # The runner is linux/amd64 so no cross-compile is needed.
55
+      # Output goes to ./shithubd (overriding BIN) so the next step's
56
+      # `< shithubd` redirect picks it up.
57
+      - name: Build shithubd
5058
         env:
5159
           CGO_ENABLED: "0"
52
-          GOOS: linux
53
-          GOARCH: amd64
54
-        run: go build -trimpath -ldflags "-s -w" -o shithubd ./cmd/shithubd
60
+        run: make build BIN=shithubd
5561
 
5662
       - name: Configure SSH
5763
         env: