45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
name: Publicar Paquete SigPro (Gitea)
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:20-bullseye
|
|
options: >-
|
|
--dns 192.168.1.1
|
|
--add-host git.natxocc.com:host-gateway
|
|
--add-host gitea:host-gateway
|
|
|
|
steps:
|
|
- name: Checkout código
|
|
uses: actions/checkout@v4
|
|
env:
|
|
GIT_CONFIG_PARAMETERS: "'url.https://git.natxocc.com/.insteadOf=http://gitea:3000/'"
|
|
|
|
- name: Instalar Bun
|
|
run: |
|
|
curl -fsSL https://bun.sh/install | bash
|
|
echo "$HOME/.bun/bin" >> $GITHUB_PATH
|
|
|
|
- name: Build
|
|
run: |
|
|
export PATH="$HOME/.bun/bin:$PATH"
|
|
bun install
|
|
bun run build
|
|
|
|
- name: Publicar en Gitea
|
|
run: |
|
|
# 1. Configuramos el .npmrc para usar el token automático de Gitea
|
|
# Importante: Gitea espera el token en formato Bearer para su API de paquetes
|
|
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
|
|
|
|
# 2. Publicamos usando el comando normal de npm
|
|
# Gitea 1.25 gestionará la subida si el .npmrc está bien formado
|
|
npm publish |