| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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
- - 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
- - 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 }}
- - 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 }}
|