-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (63 loc) · 1.79 KB
/
pre-publish.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Pre Publish
on:
push:
branches:
- main
jobs:
pre-publish:
# needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Set timezone to Asia/Shanghai
uses: szenius/[email protected]
with:
timezoneLinux: "Asia/Shanghai"
- name: Echo current time
run: timedatectl
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.11.1
- name: Install pnpm
run: |
npm install -g pnpm
# pnpm config set store-dir $(pwd)/.pnpm-store
# pnpm config set recursive-optional true
- name: Install Dependence
run: pnpm install --no-frozen-lockfile
- name: Build dist
run: |
git pull -p
pnpm run build
- name: Pre publish
run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
update:
- 'main/**'
- 'types/**'
- 'utils/**'
- README.md
- package.json
- rollup.config.js
- tsconfig.json
- .babelrc
- .github/workflows/publish.yml
- name: Repository Dispatch
if: steps.changes.outputs.update == 'true'
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.TOKEN }}
# 也可以直接写成R: GITHUB_REPOSITORY
# https://docs.github.com/zh/actions/learn-github-actions/variables
repository: ${{ github.repository }}
event-type: to-publish-npm