-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (35 loc) · 1.03 KB
/
publish.yaml
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
name: Publish Package to npmjs
on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish [<newversion> | major | minor | patch ]'
required: true
default: 'patch'
jobs:
publish-to-npmjs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Clean installation
run: npm ci
- name: Create new version
run: npm version ${{ github.event.inputs.version }} -m "Upgrade to version %s"
- name: Publish to npmjs
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Commit the new version
run: |
git push origin main
git push --tags