Skip to content

Commit

Permalink
chore: add github workflow to publish packages to npm with lerna
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyk3941 committed Nov 20, 2023
1 parent 828d846 commit 67a2539
Show file tree
Hide file tree
Showing 5 changed files with 14,615 additions and 8,324 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/publish-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
workflow_dispatch:

push:
branches:
- develop
tags:
- '*'

Expand All @@ -28,7 +26,7 @@ jobs:
node-version: "18.x"
cache: npm
- run: npm ci # runs clean-install
- run: npm run build-all # build all static sites in all packages
- run: npm run build-pages # build all static sites in all packages

- name: Archive artifact
shell: sh
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish Package to NPM
run-name: Design System Packages are being published to NPM
on:
workflow_dispatch:

push:
tags:
- '*'

permissions:
contents: write # for checkout

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
# downloads latest LTS version
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
# build packages before publishing
- run: npm run build-all
- name: Publish to npm
run: lerna publish from-package --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent"
}
Loading

0 comments on commit 67a2539

Please sign in to comment.