Skip to content

Commit

Permalink
Add npm publish workflow (#226)
Browse files Browse the repository at this point in the history
* Add npm publish workflow
  • Loading branch information
bedanley authored Jan 22, 2025
1 parent 30632b2 commit 2bacb77
Show file tree
Hide file tree
Showing 7 changed files with 14,420 additions and 8,190 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code.deploy.demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
node-version: 20.x
- name: Install CDK dependencies
run: |
npm install
npm ci
- name: Deploy LISA
run: |
make deploy HEADLESS=true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code.deploy.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
node-version: 20.x
- name: Install CDK dependencies
run: |
npm install
npm ci
- name: Deploy LISA
run: |
make deploy HEADLESS=true
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/code.publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish LISA NPM Package
on:
release:
types: [released]

permissions:
contents: read
packages: write

jobs:
PublishLISA:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

SendSlackNotification:
name: Send Slack Notification
needs: [ PublishLISA ]
runs-on: ubuntu-latest
if: always()
steps:
- name: Send Notification that package has published
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.INTERNAL_DEV_SLACK_WEBHOOK_URL }}
SLACK_COLOR: ${{ contains(join(needs.*.result, ' '), 'failure') && 'failure' || 'success' }}
SLACK_TITLE: 'NPM Package Published'
SLACK_FOOTER: ''
MSG_MINIMAL: 'actions url,commit'
SLACK_MESSAGE_ON_FAILURE: '<!here> NPM Package publish FAILED for version ${{ github.event.pull_request.head.ref }}|commit>'
SLACK_MESSAGE_ON_SUCCESS: 'NPM Package published SUCCESS for ${{ github.event.pull_request.head.ref }}|commit>.'
SLACK_MESSAGE: 'NPM Publish Finished with status ${{ job.status }} for <${{ github.event.pull_request.head.ref }}|commit>'
11 changes: 3 additions & 8 deletions .github/workflows/docs.deploy.github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@ jobs:
uses: actions/configure-pages@v4
- name: Install root dependencies
run: |
npm install
- name: Install dependencies
working-directory: ./lib/docs
run: npm install
env:
CI: ""
npm ci
- name: Build with VitePress
working-directory: ./lib/docs
run: npm run build
working-directory: ./
run: npm run build -w lib/docs
env:
CI: ""
DOCS_BASE_PATH: '/LISA/'
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/test-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
node-version: 20.x
- name: Install dependencies
run: |
npm install
npm ci
- name: Run tests
run: |
npm run test
Expand All @@ -53,14 +53,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install Chatbot dependencies
working-directory: ./lib/user-interface/react
run: |
npm install
- name: Install CDK dependencies
working-directory: ./
run: |
npm install
npm ci
- uses: pre-commit/[email protected]
send_final_slack_notification:
name: Send Final Slack Notification
Expand Down
Loading

0 comments on commit 2bacb77

Please sign in to comment.