Publish to npm on Release #6
This file contains hidden or 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 Release | |
on: | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
uses: sontx/letrun/.github/workflows/build-and-test.yml@main | |
publish: | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
registry-url: 'https://registry.npmjs.org/' | |
- name: Install dependencies | |
run: npm ci # Use npm ci for a clean and consistent install | |
- name: Build all packages | |
run: npm run build:all | |
- name: Publish changed packages | |
run: npx lerna publish from-package --no-private --yes | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |