Repository navigation
chore(release): v2.26.12 (#522) #83
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release | |
| # Release estable por tag v*: goreleaser construye netpulse (con el frontend | |
| # embebido) y netpulse-collector para linux/amd64|arm64|armv7 + checksums.txt. | |
| # install.sh / install-collector.sh consumen estos assets. | |
| # Distinto de go.yml: aquello publica binarios rolling del commit en la | |
| # prerelease go-latest (para el updater del CT 226); esto publica versiones. | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: # sin tag = snapshot de prueba (no publica release) | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: app/package-lock.json | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| cache-dependency-path: | | |
| server-go/go.sum | |
| collector/go.sum | |
| # Versión del agente embebido en el servidor. Deriva del tag (v2.11.1 → | |
| # 2.11.1) y se inyecta igual en el binario del agente (main.Version) y en | |
| # el servidor (agentbin.EmbeddedAgentVersion vía .goreleaser.yaml): | |
| # alimenta el campo updateAvailable de GET /api/agents. Con | |
| # workflow_dispatch (sin tag) cae a 0.0.0 para snapshots de prueba. | |
| - name: Resuelve AGENT_VERSION desde el tag | |
| id: version | |
| run: | | |
| if [ "${{ github.ref_type }}" = "tag" ]; then | |
| echo "agent=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "agent=0.0.0" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Build frontend + copia dist al embed (necesario para go:embed y tests) | |
| run: | | |
| npm ci --no-audit --no-fund --prefix app | |
| npm run build --prefix app | |
| rm -rf server-go/internal/staticspa/dist && cp -r app/dist server-go/internal/staticspa/dist | |
| # Antes de los tests: TestOpenArmVariants abre los binarios embebidos | |
| # (mismo orden que go.yml desde #459; aquí faltó aplicarlo y las | |
| # releases v2.25.0+ se quedaron sin assets). OJO los nombres: Open() | |
| # resuelve "agents/netpulse-agent-" + normalizeArch(arch) y esta mapea | |
| # armv7/armv7l/armhf -> arm, asi que el fichero se llama | |
| # netpulse-agent-arm (con GOARM=7), NO netpulse-agent-armv7 (#458). | |
| - name: Build agent binaries para embed (todas las arquitecturas) | |
| env: | |
| CGO_ENABLED: 0 | |
| GOOS: linux | |
| run: | | |
| set -e | |
| # amd64 | |
| (cd agent && GOARCH=amd64 go build -trimpath -ldflags "-s -w -X main.Version=${{ steps.version.outputs.agent }}" -o ../server-go/internal/agentbin/agents/netpulse-agent-amd64 ./cmd/netpulse-agent) | |
| # arm64 | |
| (cd agent && GOARCH=arm64 go build -trimpath -ldflags "-s -w -X main.Version=${{ steps.version.outputs.agent }}" -o ../server-go/internal/agentbin/agents/netpulse-agent-arm64 ./cmd/netpulse-agent) | |
| # armv7 (fichero "arm": el nombre que busca normalizeArch) | |
| (cd agent && GOARCH=arm GOARM=7 go build -trimpath -ldflags "-s -w -X main.Version=${{ steps.version.outputs.agent }}" -o ../server-go/internal/agentbin/agents/netpulse-agent-arm ./cmd/netpulse-agent) | |
| # mipsle/mips softfloat (#488): MIPS sin FPU, ambos endianness | |
| (cd agent && GOARCH=mipsle GOMIPS=softfloat go build -trimpath -ldflags "-s -w -X main.Version=${{ steps.version.outputs.agent }}" -o ../server-go/internal/agentbin/agents/netpulse-agent-mipsle ./cmd/netpulse-agent) | |
| (cd agent && GOARCH=mips GOMIPS=softfloat go build -trimpath -ldflags "-s -w -X main.Version=${{ steps.version.outputs.agent }}" -o ../server-go/internal/agentbin/agents/netpulse-agent-mips ./cmd/netpulse-agent) | |
| - name: Tests Go (ambos módulos) | |
| run: | | |
| (cd server-go && go test ./...) | |
| (cd collector && go test ./...) | |
| - name: Valida config goreleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: '~> v2' | |
| args: check | |
| - name: Release (tag v* — publica) | |
| if: github.ref_type == 'tag' | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: '~> v2' | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| AGENT_VERSION: ${{ steps.version.outputs.agent }} | |
| - name: Release (workflow_dispatch — snapshot sin publicar) | |
| if: github.ref_type != 'tag' | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: '~> v2' | |
| args: release --clean --snapshot | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| AGENT_VERSION: ${{ steps.version.outputs.agent }} |