Files
LucaZanni dae2a74437 feat(ci): aggiungi l'input working-directory ai reusable workflow Node
- quality-gates, dependency-check, dependency-outdated, npm-publish e
  auto-release accettano ora working-directory (default "."), applicato via
  defaults.run a livello di job: copre tutti gli step run senza toccare gli
  step uses, che devono restare sulla root
- Allineate le varianti -github dei cinque workflow
- Sblocca i repo dove package.json non e' in root (pzeta-calendar in
  typescript/, pzeta-king in server/), che finora dovevano rinunciare ai
  template e reinlineare i job, perdendo la working-directory a ogni
  riallineamento
- Retrocompatibile: con l'input omesso il comportamento resta identico

refs #4
2026-08-01 19:30:03 +02:00

62 lines
1.6 KiB
YAML

name: Publish npm Package
on:
workflow_call:
inputs:
working-directory:
description: 'Cartella che contiene package.json, relativa alla root del repo. Default: la root.'
type: string
default: '.'
node-version:
type: string
default: '24.16.0'
jobs:
npm-publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory || '.' }}
steps:
- name: Checkout
uses: https://gitea.com/actions/checkout@v6
- name: Setup Node.js
uses: https://gitea.com/actions/setup-node@v4
with:
node-version: ${{ inputs.node-version || '24.16.0' }}
- name: Cache npm
uses: https://github.com/actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Configure npm private registry
run: |
echo "@pzeta:registry=https://gitea.pzetatouch.it/api/packages/pzeta_touch/npm/" >> ~/.npmrc
echo "//gitea.pzetatouch.it/api/packages/pzeta_touch/npm/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint:check
- name: Type check
run: npm run typecheck
- name: Format check
run: npm run format:check
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Publish
run: npm publish