-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (38 loc) · 1006 Bytes
/
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
name: Release
on:
release:
types: [created]
jobs:
publish-package:
name: Publish package
runs-on: ubuntu-latest
timeout-minutes: 5
env:
FORCE_COLOR: true
HUSKY_SKIP_INSTALL: 1
HUSKY_SKIP_HOOKS: 1
HUSKY: 0
steps:
- name: Check out
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 16
registry-url: https://registry.npmjs.org
- name: Extract tag version
id: extract-tag-version
run: |
TAG="${GITHUB_REF:10}"
TAG_VERSION="${TAG//v/}"
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
- name: Build
run: |
npm ci
npm run build
- name: Publish
run: |
npm version --no-commit-hooks --no-git-tag-version ${{ env.TAG_VERSION }} && \
npm publish --access public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}