chore: update workflow to publish to npm
This commit is contained in:
parent
ad9f303380
commit
3fdba6e880
1 changed files with 32 additions and 28 deletions
60
.github/workflows/release.yml
vendored
60
.github/workflows/release.yml
vendored
|
@ -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,30 +23,32 @@ 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:
|
||||||
with:
|
- uses: actions/checkout@v2
|
||||||
node-version: 16
|
- uses: actions/setup-node@v1
|
||||||
registry-url: 'https://registry.npmjs.org'
|
with:
|
||||||
- name: Build Packages
|
node-version: 16
|
||||||
if: ${{ steps.release.outputs.releases_created }}
|
registry-url: 'https://registry.npmjs.org'
|
||||||
working-directory: ./app
|
- name: Build Packages
|
||||||
run: |
|
run: |
|
||||||
npm install
|
cd ${{ matrix.path }}
|
||||||
npx lerna bootstrap
|
npm install
|
||||||
|
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
|
||||||
- name: Publish to NPM
|
- name: Publish to NPM
|
||||||
if: ${{ steps.release.outputs.releases_created }}
|
if: ${{ steps.release.outputs.releases_created }}
|
||||||
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
|
Loading…
Reference in a new issue