-
-
Notifications
You must be signed in to change notification settings - Fork 21
97 lines (83 loc) · 2.52 KB
/
ci.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: ci
on:
push:
branches: main
# paths-ignore:
# - '**/*.md'
# - 'examples/**/*.html'
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: load cache
uses: actions/cache@v4
with:
path: |
~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}
- uses: pnpm/action-setup@v4
with:
version: latest
run_install: true
- name: build packs
run: |
pnpm build:cache
- name: run test
run: |
pnpm test
- name: create versions or publish to npm registry
uses: changesets/action@v1
id: changesets
with:
publish: pnpm release
commit: 'ci(changeset): release oplayer'
env:
GITHUB_TOKEN: ${{ secrets.GIT_HUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
## @oplayer/full
- name: \@oplayer/full npm publish
if: steps.changesets.outputs.published == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd packages/full
pnpm version prerelease --no-commit-hooks --no-git-tag-version --allow-same-version
cd ../../
pnpm --filter=@oplayer/full run build
pnpm --filter=@oplayer/full publish --no-git-checks
# - uses: simenandre/publish-with-pnpm@v2
# with:
# npm-auth-token: ${{ secrets.NPM_TOKEN }}
- name: Push version changes to main branch
if: steps.changesets.outputs.published == 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[skip ci]chore: release ${{ github.event.release.tag_name }}'
branch: ${{ github.event.repository.default_branch }}
file_pattern: packages/full/package.json
# 已被墙
# - name: build websites
# run: |
# pnpm i yarn -g
# cd website
# yarn
# yarn build:ghp
# - name: deploy to github pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GIT_HUB_TOKEN }}
# publish_dir: ./website/build
# publish_branch: gh-pages