-
Notifications
You must be signed in to change notification settings - Fork 14
104 lines (87 loc) · 3.26 KB
/
web.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
98
99
100
101
102
103
104
name: Build Web
on:
push:
branches:
- master
workflow_dispatch:
env:
owner: ObsidianLabs
own_components: ckb-components
share_components: electron-components
project_build: ckb
project_project: ckb
project_name: CKB Studio
project_build_script: yarn && PUBLIC_URL=/ CDN=true yarn build:react
enable_auth: true
jobs:
# Build and release
release:
runs-on: ubuntu-18.04
steps:
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 12
- name: Checkout ${{ env.share_components }}
uses: actions/checkout@v2
with:
repository: ${{ env.owner }}/${{ env.share_components }}
ref: master
path: ./${{ env.share_components }}
token: ${{ secrets.obsidians_token }}
- name: Checkout ${{ env.own_components }}
uses: actions/checkout@v2
with:
repository: ${{ env.owner }}/${{ env.own_components }}
ref: master
path: ./${{ env.own_components }}
token: ${{ secrets.obsidians_token }}
- name: Checkout ${{ env.project_name }}
uses: actions/checkout@v2
with:
ref: master
path: ./studio
- name: Install ${{ env.share_components }} submodule
working-directory: ./${{ env.share_components }}
run: git submodule update --init
- name: Install ${{ env.share_components }} dependencies
working-directory: ./${{ env.share_components }}
run: yarn
- name: Build ${{ env.share_components }}
working-directory: ./${{ env.share_components }}
run: yarn build
- name: Install ${{ env.own_components }} submodule
working-directory: ./${{ env.own_components }}
run: git submodule update --init
- name: Install ${{ env.own_components }} dependencies
working-directory: ./${{ env.own_components }}
run: yarn
- name: Build ${{ env.own_components }}
working-directory: ./${{ env.own_components }}
run: yarn build
- name: Build ${{ env.project_name }}
uses: ObsidianLabs/studio-build-action@master
with:
build: ${{ env.project_build }}
project: ${{ env.project_project }}
project_name: ${{ env.project_name }}
build_script: ${{ env.project_build_script }}
working-directory: ./studio
enable_auth: ${{ env.enable_auth }}
fontawesome_token: ${{ secrets.fontawesome_token }}
mac_certs: ${{ secrets.certs }}
mac_certs_password: ${{ secrets.certs_password }}
windows_certs: ${{ secrets.certs }}
windows_certs_password: ${{ secrets.certs_password }}
react_app_mixpanel_token: ${{ secrets.react_app_mixpanel_token }}
github_token: ${{ github.token }}
- name: Create placeholder for COS
run: echo cos > ./.placeholder
- name: Upload to COS
uses: zkqiang/[email protected]
with:
args: upload ./.placeholder / && delete -r -f / && upload -r ./studio/build/ /
secret_id: ${{ secrets.tencent_cloud_secretid }}
secret_key: ${{ secrets.tencent_cloud_secretkey }}
bucket: ${{ secrets.cos_bucket }}
region: ${{ secrets.cos_region }}