-
Notifications
You must be signed in to change notification settings - Fork 68
143 lines (119 loc) · 4.51 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Build Web
on:
push:
branches:
- master
workflow_dispatch:
env:
owner: ObsidianLabs
own_components: bsc-components
share_components: electron-components
eth_components: eth-components
project_build: eth
project_project: bsc
project_name: BNB Studio
project_build_script: yarn && PUBLIC_URL=/ CDN=true yarn build:react
enable_auth: true
premium_editor: ../premium-editor
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: 16
- 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.eth_components }}
uses: actions/checkout@v2
with:
repository: ${{ env.owner }}/${{ env.eth_components }}
ref: master
path: ./${{ env.eth_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 Premium Editor
uses: actions/checkout@v2
with:
repository: ${{ env.owner }}/premium-editor
ref: develop
path: ./premium-editor
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.eth_components }} submodule
working-directory: ./${{ env.eth_components }}
run: git submodule update --init
- name: Install ${{ env.eth_components }} dependencies
working-directory: ./${{ env.eth_components }}
run: yarn
- name: Build ${{ env.eth_components }}
working-directory: ./${{ env.eth_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: Install Premium Editor dependencies
working-directory: ./premium-editor
run: yarn
- name: Build Premium Editor
working-directory: ./premium-editor
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 }}
premium_editor: ${{ env.premium_editor }}
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 }}