-
Notifications
You must be signed in to change notification settings - Fork 5
32 lines (32 loc) · 1.05 KB
/
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
name: Publish Package to npmjs
on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Prepare git
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- name: Install yarn
run: npm i -g yarn
- name: Yarn Install
run: yarn
- name: Build
run: yarn build
- name: Test
run: yarn test
- name: Verify Versions
run: node -e "if ('refs/tags/v' + require('./package.json').version !== '${{ github.ref }}') { console.log('::error' + 'Version Mismatch. refs/tags/v' + require('./package.json').version, '${{ github.ref }}'); throw Error('Version Mismatch')} "
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_BSV }}