Skip to content

chore: set npm auth from the pipeline #73

chore: set npm auth from the pipeline

chore: set npm auth from the pipeline #73

name: 🪩 Create Gleamy NPM package
on:
push:
tags:
- "*"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.15.1]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: 9.5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
env:
NODE_ENV: production
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
- run: pnpm install -r
- run: pnpm run lint
- run: pnpm run test
build:
needs: [test]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.15.1]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: 9.5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
env:
node-version: ${{ matrix.node-version }}
NODE_ENV: production
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
- run: echo "publishing version ${{ env.RELEASE_VERSION }}"
- run: pnpm version ${{ env.RELEASE_VERSION }}
- run: npm config set //registry.npmjs.org/:_authToken ${{secrets.NPM_PUBLISH_TOKEN}}
- run: pnpm config set //registry.npmjs.org/:_authToken ${{secrets.NPM_PUBLISH_TOKEN}}
- run: pnpm publish:package
env:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
NODE_ENV: production
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}