-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.17 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
33
34
35
36
37
38
name: publish
on:
push:
tags:
- 'v*.*.*'
jobs:
publish:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- name: get semantic release info
run: echo new_release_version=${GITHUB_REF:11} >> $GITHUB_ENV
- name: get package version
id: package
uses: notiz-dev/github-action-json-property@release
with:
path: 'packages/check/package.json'
prop_path: 'version'
- name: check package version
if: ${{ steps.package.outputs.prop != env.new_release_version }}
run: |
echo "invalid package version, expected: ${{env.new_release_version}}, got: ${{steps.package.outputs.prop}}"
exit 1
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: yarn-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- name: create .npmrc file
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc
- run: cd packages/check && npm publish --access public --tag alpha