CI / build (pull_request) Successful in 24s
One secret name across forges: Gitea's NPM_AUTH (org-level) = the Verdaccio token for staging; GitHub's NPM_AUTH = the npmjs token for production. Each forge supplies its own value. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
29 lines
1.0 KiB
YAML
29 lines
1.0 KiB
YAML
name: Stage → Verdaccio
|
|
|
|
# Staging publish. Runs on GITEA ONLY (the `if` guards against GitHub), on every merge
|
|
# to main. Publishes the package as-is — version comes from package.json (a prerelease
|
|
# like 26.7.1-stg.N) — to the internal Verdaccio under the `stg` dist-tag. Verdaccio
|
|
# allows overwrite, so re-publishing the same version is a no-op-ish refresh.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
publish-stg:
|
|
if: ${{ github.server_url != 'https://github.com' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
- run: npm ci
|
|
# `npm publish` runs prepublishOnly (lint + complexity + typecheck + test + build)
|
|
# as its own gate before anything leaves the machine.
|
|
- name: Publish to Verdaccio
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH }}
|
|
run: |
|
|
npm config set //npm.svc.zoit.services/:_authToken "$NODE_AUTH_TOKEN"
|
|
npm publish --registry https://npm.svc.zoit.services --tag stg
|