chore: update workflow to publish to npm

This commit is contained in:
Bill Church 2022-08-07 11:55:08 +00:00
parent ad9f303380
commit 3fdba6e880
No known key found for this signature in database
GPG key ID: 10DD056C65752AA0

View file

@ -12,8 +12,10 @@ on:
- '**.md' - '**.md'
jobs: jobs:
release-please: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
paths_released: ${{ steps.manifest_release.outputs.paths_released }}
steps: steps:
- uses: google-github-actions/release-please-action@v3 - uses: google-github-actions/release-please-action@v3
with: with:
@ -21,24 +23,24 @@ jobs:
command: manifest command: manifest
package-name: webssh2 package-name: webssh2
path: app path: app
publish:
# The logic below handles the npm publication: runs-on: ubuntu-latest
- name: Checkout Repository needs: release
if: ${{ steps.release.outputs.releases_created }} strategy:
uses: actions/checkout@v2 fail-fast: false
- name: Setup Node matrix:
uses: actions/setup-node@v1 path: ${{fromJson(needs.release.outputs.paths_released)}}
if: ${{ steps.release.outputs.releases_created }} steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with: with:
node-version: 16 node-version: 16
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
- name: Build Packages - name: Build Packages
if: ${{ steps.release.outputs.releases_created }}
working-directory: ./app
run: | run: |
cd ${{ matrix.path }}
npm install npm install
npx lerna bootstrap npx lerna bootstrap
# Release Please has already incremented versions and published tags, so we just # Release Please has already incremented versions and published tags, so we just
# need to publish all unpublished versions to NPM here # need to publish all unpublished versions to NPM here
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package # See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
@ -47,4 +49,6 @@ jobs:
working-directory: ./app working-directory: ./app
env: env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npx lerna publish from-package --no-push --no-private --yes run: |
cd ${{ matrix.path }}
npx lerna publish from-package --no-push --no-private --yes