-
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (34 loc) · 1 KB
/
npm-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
name: Publish packages
on:
push:
branches:
- main
jobs:
public:
name: Publish
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'Bump version')"
defaults:
run:
working-directory: ./
steps:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Checkout repository
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Check package version
id: pkgver
run: |
echo "::set-output name=local::$(node -p -e "require('./package.json').version")"
echo "::set-output name=remote::$(yarn info -s $(node -p -e "require('./package.json').name") version)"
- name: Publish package
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }}
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}
package: package.json
access: public