61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
name: Manual NPM Publish
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
dist_tag:
|
|
description: "npm dist-tag"
|
|
required: false
|
|
default: dev
|
|
type: string
|
|
workflow_call:
|
|
inputs:
|
|
dist_tag:
|
|
required: false
|
|
type: string
|
|
default: dev
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NODE_VERSION: 20
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
registry-url: https://registry.npmjs.org
|
|
|
|
- name: Ensure npm >=11.5.1
|
|
run: npm install -g npm@latest
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --workspaces
|
|
|
|
- name: Ensure rollup native binary
|
|
run: npm install @rollup/rollup-linux-x64-gnu --no-save
|
|
|
|
- name: Build server package (includes UI bundling)
|
|
run: npm run build --workspace @neuralnomads/codenomad
|
|
|
|
- name: Set publish metadata
|
|
run: |
|
|
VERSION=$(node -p "require('./package.json').version")
|
|
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
|
|
echo "DIST_TAG=${{ inputs.dist_tag || 'dev' }}" >> "$GITHUB_ENV"
|
|
|
|
- name: Publish server package with provenance
|
|
env:
|
|
NPM_CONFIG_PROVENANCE: true
|
|
NPM_CONFIG_REGISTRY: https://registry.npmjs.org
|
|
run: |
|
|
npm publish --workspace @neuralnomads/codenomad --access public --tag ${DIST_TAG} --provenance
|