Actualizar .github/workflows/publish.yml

This commit is contained in:
2026-04-27 20:58:03 +02:00
parent 8b07f06854
commit 7b3b3bcacc

View File

@@ -1,11 +1,14 @@
name: Publish to NPM name: Publish to NPM (Manual)
on: on:
release: workflow_dispatch:
types: [published] inputs:
version:
description: 'Versión a publicar (ej: 1.0.0)'
required: true
jobs: jobs:
build: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: node:20-bullseye image: node:20-bullseye
@@ -13,29 +16,25 @@ jobs:
--dns 192.168.1.1 --dns 192.168.1.1
--add-host git.natxocc.com:host-gateway --add-host git.natxocc.com:host-gateway
--add-host gitea:host-gateway --add-host gitea:host-gateway
steps: steps:
- name: Forzar Dominio Limpio - name: Clone source from Gitea
run: | run: |
# Redirigimos cualquier intento (IP o nombre interno) al dominio limpio git clone https://git.natxocc.com/natxocc/sigpro-ui.git source
git config --global url."http://git.natxocc.com/".insteadOf "http://gitea:3000/" cd source
git config --global url."http://git.natxocc.com/".insteadOf "http://192.168.1.100:3333/" git checkout main
git config --global --add safe.directory /workspace/natxocc/sigpro - name: Configurar Git para dependencias
git config --global http.sslVerify false run: |
git config --global url."https://git.natxocc.com/".insteadOf "http://gitea:3000/"
- name: Checkout código
uses: actions/checkout@v4
with:
fetch-depth: 1
env:
GIT_CONFIG_PARAMETERS: "'url.https://git.natxocc.com/.insteadOf=http://gitea:3000/'"
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v1
with: with:
bun-version: latest bun-version: latest
- name: Install & Publish - name: Install and publish
run: | run: |
cd source
bun install bun install
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
npm publish --access public npm publish --access public