Skip to content

Publish to npm

Publish to npm #27

Workflow file for this run

name: Publish to npm
on:
workflow_dispatch:
inputs:
next:
description: Is it a dev / next release ?
required: true
type: boolean
branch:
description: Branch to publish from
required: true
type: string
default: 'main'
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
build:
env:
branch: ${{ inputs.branch }}
stage: ${{ inputs.next == true && 'next' || 'latest' }}
build: ${{ inputs.next == true && 'next' || 'production' }}
ELECTRON_EXTRA_LAUNCH_ARGS: '--disable-gpu'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ env.branch }}
token: ${{secrets.DONTCODE_ACTIONS_TOKEN}}
- name: Git config user
uses: snow-actions/git-config-user@v1.0.0
with:
name: Ng-Xtend team
email: contact@ng-xtend.dev
- uses: actions/setup-node@v6
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Display Versions
run: |
XT_TYPE_VERSION=$(node -p "require('./libs/xt-type/package.json').version")
echo "XT_TYPE_VERSION : $XT_TYPE_VERSION"
XT_VERSION=$(node -p "require('./libs/xt-components/package.json').version")
echo "XT_VERSION : $XT_VERSION"
- name: Install
run: |
node common/scripts/install-run-rush.js install
- name: Build
run: |
node common/scripts/install-run-rush.js build-deploy-${{env.stage}}
- name: Publish libraries to ${{env.stage}}
run: |
cd libs/xt-type
node ../../common/scripts/install-run-rush-pnpm.js publish --access public --tag ${{env.stage}}
cd ../..
npm publish libs/xt-store/dist/store --access public --tag ${{env.stage}}
npm publish libs/xt-components/dist/xt-components --access public --tag ${{env.stage}}
npm publish libs/xt-plugin-sample/dist/xt-plugin-sample --access public --tag ${{env.stage}}
- name: Publish plugins to ${{env.stage}}
run: |
npm publish plugins/xt-idb-store/dist/store --access public --tag ${{env.stage}}
npm publish plugins/xt-default/dist/xt-plugin-default --access public --tag ${{env.stage}}
npm publish plugins/xt-web/dist/xt-plugin-web --access public --tag ${{env.stage}}
npm publish plugins/xt-intl/dist/xt-plugin-intl --access public --tag ${{env.stage}}
npm publish plugins/xt-finance/dist/xt-plugin-finance --access public --tag ${{env.stage}}
npm publish plugins/xt-agenda/dist/xt-plugin-agenda --access public --tag ${{env.stage}}