-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (30 loc) · 896 Bytes
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Publish Package on npmjs
on:
push:
branches: ['main']
pull_request:
branches: ['main']
workflow_dispatch:
jobs:
publish:
environment: CI
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'release-please--branches--main')"
steps:
- uses: actions/checkout@v3
- name: ⬇️ Setup Node.js environment
uses: actions/[email protected]
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: 🔨 Install dependencies
run: npm ci --ignore-scripts
- name: 📦 Bundle package
run: npm run build
- name: 🫡 Configure npm
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- name: 🚀 Publish package on npmjs
run: npm publish
env:
NPM_TOKEN: ${{ secrets.NPMJS_SECRET }}