Skip to content

Commit 2bacb77

Browse files
authored
Add npm publish workflow (#226)
* Add npm publish workflow
1 parent 30632b2 commit 2bacb77

7 files changed

+14420
-8190
lines changed

.github/workflows/code.deploy.demo.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
node-version: 20.x
4343
- name: Install CDK dependencies
4444
run: |
45-
npm install
45+
npm ci
4646
- name: Deploy LISA
4747
run: |
4848
make deploy HEADLESS=true

.github/workflows/code.deploy.dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
node-version: 20.x
4343
- name: Install CDK dependencies
4444
run: |
45-
npm install
45+
npm ci
4646
- name: Deploy LISA
4747
run: |
4848
make deploy HEADLESS=true

.github/workflows/code.publish.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish LISA NPM Package
2+
on:
3+
release:
4+
types: [released]
5+
6+
permissions:
7+
contents: read
8+
packages: write
9+
10+
jobs:
11+
PublishLISA:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
# Setup .npmrc file to publish to GitHub Packages
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: '20.x'
22+
registry-url: 'https://npm.pkg.github.com'
23+
- run: npm ci
24+
- run: npm publish
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
28+
SendSlackNotification:
29+
name: Send Slack Notification
30+
needs: [ PublishLISA ]
31+
runs-on: ubuntu-latest
32+
if: always()
33+
steps:
34+
- name: Send Notification that package has published
35+
uses: rtCamp/action-slack-notify@v2
36+
env:
37+
SLACK_WEBHOOK: ${{ secrets.INTERNAL_DEV_SLACK_WEBHOOK_URL }}
38+
SLACK_COLOR: ${{ contains(join(needs.*.result, ' '), 'failure') && 'failure' || 'success' }}
39+
SLACK_TITLE: 'NPM Package Published'
40+
SLACK_FOOTER: ''
41+
MSG_MINIMAL: 'actions url,commit'
42+
SLACK_MESSAGE_ON_FAILURE: '<!here> NPM Package publish FAILED for version ${{ github.event.pull_request.head.ref }}|commit>'
43+
SLACK_MESSAGE_ON_SUCCESS: 'NPM Package published SUCCESS for ${{ github.event.pull_request.head.ref }}|commit>.'
44+
SLACK_MESSAGE: 'NPM Publish Finished with status ${{ job.status }} for <${{ github.event.pull_request.head.ref }}|commit>'

.github/workflows/docs.deploy.github-pages.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,10 @@ jobs:
3131
uses: actions/configure-pages@v4
3232
- name: Install root dependencies
3333
run: |
34-
npm install
35-
- name: Install dependencies
36-
working-directory: ./lib/docs
37-
run: npm install
38-
env:
39-
CI: ""
34+
npm ci
4035
- name: Build with VitePress
41-
working-directory: ./lib/docs
42-
run: npm run build
36+
working-directory: ./
37+
run: npm run build -w lib/docs
4338
env:
4439
CI: ""
4540
DOCS_BASE_PATH: '/LISA/'

.github/workflows/test-and-lint.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
node-version: 20.x
3636
- name: Install dependencies
3737
run: |
38-
npm install
38+
npm ci
3939
- name: Run tests
4040
run: |
4141
npm run test
@@ -53,14 +53,10 @@ jobs:
5353
uses: actions/setup-node@v3
5454
with:
5555
node-version: 20.x
56-
- name: Install Chatbot dependencies
57-
working-directory: ./lib/user-interface/react
58-
run: |
59-
npm install
6056
- name: Install CDK dependencies
6157
working-directory: ./
6258
run: |
63-
npm install
59+
npm ci
6460
- uses: pre-commit/[email protected]
6561
send_final_slack_notification:
6662
name: Send Final Slack Notification

0 commit comments

Comments
 (0)