Actualizar .github/workflows/publicar-paquete.yml
This commit is contained in:
40
.github/workflows/publicar-paquete.yml
vendored
40
.github/workflows/publicar-paquete.yml
vendored
@@ -1,36 +1,48 @@
|
|||||||
name: Publicar Paquete SigPro (NPM)
|
name: Publicar Paquete SigPro (NPM)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # Botón manual
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*' # Se ejecuta al subir un tag como v1.2.12
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest # Usará tu runner configurado
|
runs-on: ubuntu-latest
|
||||||
|
# AÑADIMOS ESTO (Igual que en tu Deploy Docs)
|
||||||
|
container:
|
||||||
|
image: node:20-bullseye
|
||||||
|
options: >-
|
||||||
|
--dns 192.168.1.1
|
||||||
|
--add-host git.natxocc.com:host-gateway
|
||||||
|
--add-host gitea:host-gateway
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout código
|
- name: Checkout código
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
env:
|
env:
|
||||||
|
# Tu truco de GIT_CONFIG_PARAMETERS es genial, mantenlo
|
||||||
GIT_CONFIG_PARAMETERS: "'url.https://git.natxocc.com/.insteadOf=http://gitea:3000/'"
|
GIT_CONFIG_PARAMETERS: "'url.https://git.natxocc.com/.insteadOf=http://gitea:3000/'"
|
||||||
|
|
||||||
- name: Instalar Bun
|
- name: Instalar Bun
|
||||||
uses: oven-sh/setup-bun@v1
|
run: |
|
||||||
with:
|
curl -fsSL https://bun.sh/install | bash
|
||||||
bun-version: latest
|
echo "$HOME/.bun/bin" >> $GITHUB_PATH
|
||||||
|
# Nota: Usamos comando directo porque algunas Actions de terceros
|
||||||
|
# a veces fallan dentro de contenedores personalizados.
|
||||||
|
|
||||||
- name: Instalar dependencias
|
- name: Instalar dependencias
|
||||||
run: bun install
|
run: |
|
||||||
|
export PATH="$HOME/.bun/bin:$PATH"
|
||||||
|
bun install
|
||||||
|
|
||||||
- name: Ejecutar Build
|
- name: Ejecutar Build
|
||||||
run: bun run build
|
|
||||||
|
|
||||||
- name: Configurar Registro Gitea
|
|
||||||
run: |
|
run: |
|
||||||
# Configura el registro de Gitea para el scope de tu usuario/paquete
|
export PATH="$HOME/.bun/bin:$PATH"
|
||||||
|
bun run build
|
||||||
|
|
||||||
|
- name: Configurar Registro Gitea y Publicar
|
||||||
|
run: |
|
||||||
echo "@natxocc:registry=https://git.natxocc.com/api/packages/natxocc/npm/" >> .npmrc
|
echo "@natxocc:registry=https://git.natxocc.com/api/packages/natxocc/npm/" >> .npmrc
|
||||||
echo "//git.natxocc.com/api/packages/natxocc/npm/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
|
echo "//git.natxocc.com/api/packages/natxocc/npm/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
|
||||||
|
npm publish
|
||||||
- name: Publicar en Gitea
|
|
||||||
run: npm publish
|
|
||||||
Reference in New Issue
Block a user