From b5a4ed0b006186756870d93da8c9f6743b53f20c Mon Sep 17 00:00:00 2001 From: bedanley Date: Wed, 22 Jan 2025 09:21:10 -0700 Subject: [PATCH] Create npm-publish-github-packages.yml --- .../workflows/npm-publish-github-packages.yml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/npm-publish-github-packages.yml diff --git a/.github/workflows/npm-publish-github-packages.yml b/.github/workflows/npm-publish-github-packages.yml new file mode 100644 index 00000000..77048596 --- /dev/null +++ b/.github/workflows/npm-publish-github-packages.yml @@ -0,0 +1,44 @@ +name: Publish LISA NPM GitHub 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: ' 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>'