Publish to NPM registry (Prerelease) #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |