-
Notifications
You must be signed in to change notification settings - Fork 4
222 lines (210 loc) · 6.57 KB
/
build.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
name: Build/release
on:
push:
# Sequence of patterns matched against refs/heads
branches:
- 'ci/**'
- 'ci-**'
- 'releases/**'
- 'dev'
- 'master'
- 'test_ci'
- 'feat/**'
tags:
- v0.*.*
- v1.*.*
pull_request:
branches:
- 'dev'
# release:
# # Only use the types keyword to narrow down the activity types that will trigger your workflow.
# types: [published, created, edited]
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
include:
- os: ubuntu-20.04
target_arch: amd64
build_type: release
- os: ubuntu-20.04
target_arch: amd64
build_type: debug
- os: ubuntu-20.04
target_arch: i386
build_type: release
- os: ubuntu-20.04
target_arch: i386
build_type: debug
- os: ubuntu-20.04
target_arch: arm64
build_type: release
- os: ubuntu-20.04
target_arch: arm64
build_type: debug
- os: ubuntu-20.04
target_arch: arm
build_type: release
- os: ubuntu-20.04
target_arch: arm
build_type: debug
- os: ubuntu-20.04
target_arch: mips64
build_type: release
- os: ubuntu-20.04
target_arch: mips64
build_type: debug
- os: ubuntu-20.04
target_arch: ppc64
build_type: release
- os: ubuntu-20.04
target_arch: ppc64
build_type: debug
- os: ubuntu-20.04
target_arch: riscv64
build_type: release
- os: ubuntu-20.04
target_arch: riscv64
build_type: debug
- os: ubuntu-20.04
target_arch: loong64
build_type: release
- os: ubuntu-20.04
target_arch: loong64
build_type: debug
- os: ubuntu-20.04
build_target: alpine
target_arch: amd64
build_type: release
- os: ubuntu-20.04
build_target: alpine
target_arch: i386
build_type: release
- os: ubuntu-20.04
build_target: alpine
target_arch: arm64
build_type: release
- os: ubuntu-20.04
build_target: android
target_arch: amd64
build_type: release
- os: ubuntu-20.04
build_target: android
target_arch: arm64
build_type: release
- os: windows-2022
target_arch: amd64
build_type: release
- os: windows-2022
target_arch: amd64
build_type: debug
- os: windows-2022
target_arch: i386
build_type: release
- os: windows-2022
target_arch: i386
build_type: debug
- os: windows-2022
target_arch: arm64
build_type: release
- os: windows-2022
target_arch: arm64
build_type: debug
- os: macos-11
target_arch: amd64
build_type: release
- os: macos-11
target_arch: amd64
build_type: debug
- os: macos-11
target_arch: arm64
build_type: release
- os: macos-11
target_arch: arm64
build_type: debug
- os: macos-11
build_target: iphone
target_arch: arm64
build_type: release
steps:
- name: Switch XCode to 13.0
uses: maxim-lobanov/setup-xcode@v1
if: runner.os == 'macOS'
with:
xcode-version: '13.0'
- name: Check out Git repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set Env Variables
id: set-env-vars
shell: bash
run: |
bash .github/workflows/set-env-vars.sh
env:
TARGET_ARCH: ${{ matrix.target_arch }}
BUILD_TYPE: ${{ matrix.build_type }}
BUILD_TARGET: ${{ matrix.build_target }}
- name: Setup ubuntu
if: runner.os == 'Linux'
shell: bash
run: |
bash .github/workflows/setup_ubuntu.sh
env:
TARGET_ARCH: ${{ matrix.target_arch }}
BUILD_TARGET: ${{ matrix.build_target }}
- name: Build
shell: bash
run: |
bash .github/workflows/build.sh
env:
TARGET_ARCH: ${{ matrix.target_arch }}
BUILD_TYPE: ${{ matrix.build_type }}
BUILD_TARGET: ${{ matrix.build_target }}
- name: Package
shell: bash
run: |
bash .github/workflows/pack.sh
env:
RELEASE_TAG: ${{ steps.set-env-vars.outputs.RELEASE_TAG }}
TARGET_OS: ${{ steps.set-env-vars.outputs.TARGET_OS }}
DIST_FILE: ${{ steps.set-env-vars.outputs.DIST_FILE }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
if: ${{ steps.set-env-vars.outputs.IS_UPLOAD_ASSETS != '' && steps.set-env-vars.outputs.TAG_EXISTED == '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
with:
tag_name: ${{ steps.set-env-vars.outputs.RELEASE_TAG }}
release_name: Release ${{ steps.set-env-vars.outputs.RELEASE_TAG }}
body: ${{ steps.set-env-vars.outputs.GIT_COMMIT_HEAD_MSG }}
draft: false
prerelease: true
- name: Github Release
id: upload-release-asset
uses: softprops/action-gh-release@v1
if: ${{ steps.set-env-vars.outputs.IS_UPLOAD_ASSETS != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: ${{ steps.set-env-vars.outputs.GIT_COMMIT_HEAD_MSG }}
draft: false
prerelease: true
files: ${{ steps.set-env-vars.outputs.DIST_FILEPATH }}
name: Release ${{ steps.set-env-vars.outputs.RELEASE_TAG }}
tag_name: ${{ steps.set-env-vars.outputs.RELEASE_TAG }}
- name: Test jssdk
id: test-jssdk
shell: bash
run: |
bash .github/workflows/jssdk_test.sh
env:
DIST_DIR: ${{ steps.set-env-vars.outputs.DIST_DIR }}
TARGET_OS_NAME: ${{ steps.set-env-vars.outputs.TARGET_OS_NAME }}
TARGET_ARCH: ${{ matrix.target_arch }}
BUILD_TYPE: ${{ matrix.build_type }}
BUILD_TARGET: ${{ matrix.build_target }}