-
Notifications
You must be signed in to change notification settings - Fork 26
44 lines (35 loc) · 1 KB
/
release.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
39
40
41
42
43
44
name: Release npm package
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Configure Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Generate release version
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_KEY }}
- name: Push version changes
run: |
git push --follow-tags origin main
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_KEY }}