Skip to content

Workflow file for this run

name: Publish Node.js package
on:
release:
types: [created]
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- uses: ./.github/actions/publish-notify
with:
stage: start
tg-bot-token: ${{ secrets.TG_BOT_TOKEN }}
tg-chat-id: ${{ secrets.TG_CHAT_ID }}
- name: Build
run: |
npm ci
npm --no-git-tag-version version ${GITHUB_REF#refs/*/}
npm run build
- name: Lint
run: npm run lint:pkg
- name: Publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
- uses: ./.github/actions/publish-notify
if: success()
with:
stage: done
tg-bot-token: ${{ secrets.TG_BOT_TOKEN }}
tg-chat-id: ${{ secrets.TG_CHAT_ID }}
- uses: ./.github/actions/publish-notify
if: failure()
with:
stage: fail
tg-bot-token: ${{ secrets.TG_BOT_TOKEN }}
tg-chat-id: ${{ secrets.TG_CHAT_ID }}