Sfoglia il codice sorgente

fix(ci): inject the latest v* tag as server version, not the agent tag (#869) (#876)

git describe --tags --abbrev=0 picked the nearest tag of any kind, so with the agent module tags (agent/vX.Y.Z) present it injected the agent version as the server display version. Filter to v[0-9]* so only release tags are considered. Closes #869
Nacho 2 mesi fa
parent
commit
55a5cb707b
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      .github/workflows/go.yml

+ 3 - 1
.github/workflows/go.yml

@@ -114,7 +114,9 @@ jobs:
         # -X httpapi.Version: la versión semver del último tag (rolling por
         # commit no tiene versión propia; reporta la del release más reciente).
         run: |
-          VER=$(git describe --tags --abbrev=0 || echo "0.0.0")
+          # --match 'v[0-9]*': sin filtro, git describe pilla el tag del AGENTE
+          # (agent/vX.Y.Z) y lo inyecta como versión del server (#869).
+          VER=$(git describe --tags --abbrev=0 --match 'v[0-9]*' || echo "0.0.0")
           go build -trimpath -ldflags "-s -w -X github.com/gnacho/netpulse/server-go/internal/updater.BuildCommit=${GITHUB_SHA::7} -X github.com/gnacho/netpulse/server-go/internal/agentbin.EmbeddedAgentVersion=${AGENT_VERSION} -X github.com/gnacho/netpulse/server-go/internal/httpapi.Version=${VER}" -o netpulse ./cmd/netpulse
 
       - name: Empaqueta binario + despliegue