-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.17 KB
/
release.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
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Release
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: "https://registry.npmjs.org"
- uses: release-drafter/release-drafter@master
with:
version: ${{ steps.version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Setup
run: npm i -g @antfu/ni pnpm
- name: Install Dependencies
run: pnpm install
- name: PNPM build
run: pnpm build
- name: Publish to NPM
run: pnpm -r publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- name: version
id: version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag#v}
major=${version%%.*}
echo "::set-output name=tag::${tag}"
echo "::set-output name=version::${version}"
echo "::set-output name=major::${major}"