build: Authenticate yarn publishing using .yarnrc.yml
(#156)
#141
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 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_publish_production_release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Authentication | |
run: | | |
echo npmAuthToken: "$NODE_AUTH_TOKEN" >> ./.yarnrc.yml | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Check package versions and publish | |
run: yarn publish |