-
Notifications
You must be signed in to change notification settings - Fork 325
66 lines (56 loc) · 1.68 KB
/
auto-publish.yml
File metadata and controls
66 lines (56 loc) · 1.68 KB
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
name: auto-publish
on:
release:
types: [created]
jobs:
publish-official-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: main
fetch-depth: 0
submodules: recursive
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
- name: update official website
run: |
git config --local user.email "tdesign@tencent.com"
git config --local user.name "tdesign-bot"
git status
git fetch origin
git merge origin/develop
git push origin main
publish-miniprogram:
if: startsWith(github.event.release.tag_name,'tdesign-miniprogram')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: 18
- run: pnpm install
- run: pnpm build
- name: extract version
id: version
run: |
const tagName = '${{ github.event.release.tag_name }}'
const lastIndex = tagName.lastIndexOf('@');
const version = tagName.slice(lastIndex + 1);
echo "version=$version" >> $GITHUB_OUTPUT
shell: bash
- name: release miniprogram
uses: LeeJim/setup-miniprogram@main
with:
project_type: miniProgram
action_type: upload
project_path: ./_example
version: ${{ steps.version.outputs.version }}
es6: true
es7: true
minify: true
env:
MINI_APP_ID: ${{ secrets.TDESIGN_APP_ID }}
MINI_APP_PRIVATE_KEY: ${{ secrets.TDESIGN_MINI_KEY }}