|
1 | | -# https://github.com/actions/create-release |
2 | | -name: release |
| 1 | +name: Release |
3 | 2 |
|
4 | 3 | on: |
| 4 | + workflow_dispatch: |
5 | 5 | push: |
6 | 6 | tags: |
7 | 7 | - 'v*' |
8 | | - workflow_dispatch: |
9 | | - |
10 | | -# 设置上海时区 |
11 | | -env: |
12 | | - TZ: Asia/Shanghai |
13 | 8 |
|
14 | 9 | jobs: |
15 | | - publish: |
| 10 | + release: |
16 | 11 | runs-on: ubuntu-latest |
17 | | - strategy: |
18 | | - matrix: |
19 | | - node-version: [ latest ] |
20 | 12 | steps: |
21 | | - - name: Checkout |
22 | | - uses: actions/checkout@v2 |
23 | | - - name: Use Node.js 🚀 |
| 13 | + - uses: actions/checkout@v3 |
24 | 14 | with: |
25 | | - node-version: '16.15.0' |
26 | | - registry-url: https://registry.npmjs.org/ |
27 | | - uses: actions/setup-node@v2 |
28 | | - - name: Cache yarn modules 🚀 |
29 | | - uses: actions/cache@v2 |
30 | | - env: |
31 | | - cache-name: cache-yarn-modules |
| 15 | + fetch-depth: 0 |
| 16 | + - name: Set node |
| 17 | + uses: actions/setup-node@v3 |
32 | 18 | with: |
33 | | - path: '**/node_modules' |
34 | | - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} |
35 | | - restore-keys: | |
36 | | - ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}- |
37 | | - - run: yarn install && npm publish --access=public |
| 19 | + node-version: 16.x |
| 20 | + registry-url: 'https://registry.npmjs.org' |
| 21 | + |
| 22 | + - name: Setup |
| 23 | + run: npm i -g @antfu/ni pnpm |
| 24 | + |
| 25 | + - run: npx changelogithub |
| 26 | + continue-on-error: true |
| 27 | + env: |
| 28 | + GITHUB_TOKEN: ${{secrets.GIT_TOKEN}} |
| 29 | + |
| 30 | + - name: Install Dependencies |
| 31 | + run: nci |
| 32 | + |
| 33 | + - name: PNPM build |
| 34 | + run: nr build |
| 35 | + |
| 36 | + - name: Publish to NPM |
| 37 | + run: pnpm -r publish --access public --no-git-checks |
38 | 38 | env: |
39 | 39 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} |
40 | | - - name: Prepare the changelog from the tag message |
41 | | - run: | |
42 | | - VERSION=${GITHUB_REF/refs\/tags\//} |
43 | | - echo "Setting release version to $VERSION" |
44 | | - echo "release_version=$VERSION" >> $GITHUB_ENV |
0 commit comments