-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (41 loc) · 1.22 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
# https://github.com/actions/create-release
name: release
on:
push:
tags:
- 'v*'
workflow_dispatch:
# 设置上海时区
env:
TZ: Asia/Shanghai
jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ latest ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 🚀
with:
node-version: '16.15.0'
registry-url: https://registry.npmjs.org/
uses: actions/setup-node@v2
- name: Cache yarn modules 🚀
uses: actions/cache@v2
env:
cache-name: cache-yarn-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- run: yarn install && npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- name: Prepare the changelog from the tag message
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
echo "Setting release version to $VERSION"
echo "release_version=$VERSION" >> $GITHUB_ENV