chore: set npm auth from the pipeline #75
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: 🪩 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: npm profile get | |
- 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}} |