Repository navigation
51 lines (43 loc) · 1.67 KB
/
Copy pathdist.yml
File metadata and controls
51 lines (43 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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@v4
- uses: actions/setup-node@v4
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@v2
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