| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- name: dist
- # Compila app/dist en CI y lo publica como asset de la prerelease "dist-latest"
- # (el CT 226 tiene 512MB y no puede compilar; el updater descarga el build
- # exacto de su commit: app-dist-<sha>.tar.gz).
- on:
- push:
- branches: [main]
- # #1271: SIN filtro de paths. El updater rolling descarga el snapshot de
- # su commit exacto: si un push solo-Go no genera snapshot, el updater
- # aplica uno viejo desalineado (le paso con main en 4b0718c y el artifact
- # de 1a9db42).
- workflow_dispatch:
- jobs:
- build:
- runs-on: ubuntu-latest
- permissions:
- contents: write # publicar assets en la prerelease dist-latest
- steps:
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- with:
- node-version: 24
- cache: npm
- cache-dependency-path: app/package-lock.json
- - name: Build frontend
- working-directory: app
- run: npm ci --no-audit --no-fund && npm run build
- - name: Empaqueta dist
- run: tar czf app-dist-${{ github.sha }}.tar.gz -C app/dist .
- - name: Publica en prerelease dist-latest
- uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2
- with:
- tag_name: dist-latest
- name: dist-latest
- prerelease: true
- files: app-dist-${{ github.sha }}.tar.gz
- - name: Limpia assets antiguos (conserva los 5 más recientes por fecha)
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- gh api repos/${{ github.repository }}/releases/tags/dist-latest \
- --jq '.assets | sort_by(.created_at) | reverse | .[5:] | .[].name' \
- | while read -r a; do gh release delete-asset dist-latest "$a" -y; done
|