-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (35 loc) · 1.02 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:
workflow_dispatch:
inputs:
version:
description: 'The new version'
required: true
type: text
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/
- uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: node_modules-
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn version --new-version "${{ github.event.release.tag_name || inputs.version }}" --no-git-tag-version
- run: yarn pack --filename package.tgz
- run: yarn publish package.tgz --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- uses: actions/upload-artifact@v2
with:
name: package
path: package.tgz