Release packages to NPM #122
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: Release packages to NPM | |
on: | |
workflow_run: | |
workflows: ["Build and execute tests"] | |
branches: [master] | |
types: | |
- completed | |
jobs: | |
on-success: | |
name: Deploy packages to NPM | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: refs/heads/master | |
- name: Use Node.js LTS | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '19' | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Build | |
run: yarn build | |
- name: Create .npmrc | |
run: "echo 'npmAlwaysAuth: true' >> .yarnrc.yml && echo 'npmAuthToken: ${NPM_TOKEN}' >> .yarnrc.yml" | |
- name: Publish to NPM with Yarn | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: yarn workspaces foreach --all --no-private npm publish --tolerate-republish ## yarn lerna publish from-package -y | |