Skip to content

Publish to NPM registry (Prerelease) #12

Publish to NPM registry (Prerelease)

Publish to NPM registry (Prerelease) #12

Workflow file for this run

name: Publish to NPM registry (Prerelease)
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
CI: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
BUILD_NUMBER: ${{ github.ref_name }}.${{ github.run_number }}.${{ github.run_attempt }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile
- run: |
PACKAGE_VERSION=$(node -pe "require('./package.json').version")
PACKAGE_VERSION="${PACKAGE_VERSION}-${BUILD_NUMBER}"
./ci/modify-package-version.sh $PACKAGE_VERSION
- run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
- run: pnpm publish --tag alpha --no-git-checks