57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: Publicar Paquete SigPro (NPM)
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
|
|
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: Instalar dependencias
|
|
run: |
|
|
export PATH="$HOME/.bun/bin:$PATH"
|
|
bun install
|
|
|
|
- name: Ejecutar Build
|
|
run: |
|
|
export PATH="$HOME/.bun/bin:$PATH"
|
|
bun run build
|
|
|
|
- name: Diagnóstico de API y URLs
|
|
run: |
|
|
echo "--- 1. Verificando Usuario y Token ---"
|
|
curl -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
https://git.natxocc.com/api/v1/user
|
|
|
|
echo -e "\n\n--- 2. Verificando Repositorio ---"
|
|
curl -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
https://git.natxocc.com/api/v1/repos/natxocc/sigpro
|
|
|
|
echo -e "\n\n--- 3. Verificando Endpoints de Paquetes ---"
|
|
# Probamos la ruta oficial de Gitea para listar paquetes de un propietario
|
|
curl -v -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
https://git.natxocc.com/api/packages/natxocc/npm/sigpro |