-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 984 Bytes
/
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
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: can-publish
run: npx can-npm-publish --verbose
- name: current-package-version
run: node -p -e '`CURRENT_PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
- name: release-draft
uses: release-drafter/release-drafter@v5
with:
name: v${{ env.CURRENT_PACKAGE_VERSION }}
tag: v${{ env.CURRENT_PACKAGE_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: npm install
run: npm ci
- name: build
run: npm run build
- name: publish-to-npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}