-
Notifications
You must be signed in to change notification settings - Fork 40
280 lines (248 loc) · 8.84 KB
/
build-1.2.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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Build (1.2-lts)
on:
schedule:
- cron: '*/30 * * * *'
jobs:
prerelease:
name: Prerelease
runs-on: macos-latest
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
outputs:
should_release: ${{ steps.check_diff.outputs.should_release }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'apache/doris'
ref: 'branch-1.2-lts'
fetch-depth: 0
- name: Check Diff
id: check_diff
run: |
tag_name='automation-1.2-lts'
title="Apache Doris Third Party Prebuilt (${tag_name/automation-/})"
if [[ -z "$(gh release list)" ]] ||
! gh release list | awk -F "\t" '{ print $3 }' | grep "${tag_name}" >/dev/null; then
gh release create -t "${title}" "${tag_name}"
fi
last_version="$(gh release view "${tag_name}" | sed -n -E 's/Doris Version: \*(.*)\*.*/\1/p')"
current_version="$(git log -1 --format='%H')"
echo "Last Version: ${last_version}"
echo "Current Version: ${current_version}"
should_release=false
if [[ -z "${last_version}" ]]; then
echo "The first release was detected."
should_release=true
elif [[ "${last_version}" != "${current_version}" ]]; then
cmd="git diff --name-only ${last_version} ${current_version} | grep -E '^thirdparty/'"
echo "Execute: ${cmd}"
content="$(eval "${cmd}")" || true
if [[ -n "${content}" ]]; then
echo -e "Detect changes:\n${content}"
should_release=true
fi
fi
if "${should_release}"; then
echo -ne "Update Time: *$(date)*\nDoris Version: *${current_version}*\nStatus: *BUILDING*" >release_note.md
else
gh release view "${tag_name}" | sed -n '/--/,$p' | awk '{ if (NR > 1) print $0 }' | sed "{
s/Update Time:.*/Update Time: *$(date)*/
s/Doris Version:.*/Doris Version: *${current_version}*/
}" >release_note.md
fi
gh release edit -F release_note.md "${tag_name}"
echo "should_release=${should_release}" >> $GITHUB_OUTPUT
- name: Download Source and Upload
if: steps.check_diff.outputs.should_release == 'true'
run: |
tag_name='automation-1.2-lts'
cd thirdparty
sed '/# unpacking thirdpart archives/,$d' download-thirdparty.sh | bash -
tar -zcvf doris-thirdparty-source.tgz src
gh release upload --clobber "${tag_name}" doris-thirdparty-source.tgz
build:
name: Build
needs: prerelease
if: needs.prerelease.outputs.should_release == 'true'
strategy:
matrix:
config:
- name: macOS-x86_64
os: macos-13
packages: >-
'm4'
'automake'
'autoconf'
'libtool'
'pkg-config'
'texinfo'
'coreutils'
'gnu-getopt'
'python@3'
'cmake'
'ninja'
'ccache'
'bison'
'byacc'
'gettext'
'wget'
'pcre'
'openjdk@11'
'maven'
'node'
'llvm@15'
- name: macOS-arm64
os: macos-14
packages: >-
'm4'
'automake'
'autoconf'
'libtool'
'pkg-config'
'texinfo'
'coreutils'
'gnu-getopt'
'python@3'
'cmake'
'ninja'
'ccache'
'bison'
'byacc'
'gettext'
'wget'
'pcre'
'openjdk@11'
'maven'
'node'
'llvm@15'
- name: Linux
os: ubuntu-22.04
packages: >-
'build-essential'
'automake'
'autoconf'
'libtool-bin'
'pkg-config'
'cmake'
'ninja-build'
'ccache'
'python-is-python3'
'bison'
'byacc'
'flex'
'binutils-dev'
'libiberty-dev'
'curl'
'git'
'zip'
'unzip'
'autopoint'
'openjdk-8-jdk'
'openjdk-8-jdk-headless'
'maven'
runs-on: ${{ matrix.config.os }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'apache/doris'
ref: 'branch-1.2-lts'
fetch-depth: 0
- name: Download
run: |
tag_name='automation-1.2-lts'
cd thirdparty
curl -L "https://github.com/${{ github.repository }}/releases/download/${tag_name}/doris-thirdparty-source.tgz" \
-o doris-thirdparty-source.tgz
tar -zxvf doris-thirdparty-source.tgz
- name: Prepare for ${{ matrix.config.os }}
run: |
if [[ "${{ matrix.config.name }}" =~ macOS-* ]]; then
brew install ${{ matrix.config.packages }} || true
else
export DEFAULT_DIR='/opt/doris'
export PATH="${DEFAULT_DIR}/ldb-toolchain/bin:${PATH}"
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt install --yes ${{ matrix.config.packages }}
mkdir -p "${DEFAULT_DIR}"
wget https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.12/ldb_toolchain_gen.sh \
-q -O /tmp/ldb_toolchain_gen.sh
bash /tmp/ldb_toolchain_gen.sh "${DEFAULT_DIR}/ldb-toolchain"
fi
- name: Build and Upload
run: |
tag_name='automation-1.2-lts'
if [[ "${{ matrix.config.name }}" == 'Linux' ]]; then
export DEFAULT_DIR='/opt/doris'
export PATH="${DEFAULT_DIR}/ldb-toolchain/bin:${PATH}"
export PATH="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 1 -type d -name 'bin'):${PATH}"
export JAVA_HOME="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 0)"
export DORIS_TOOLCHAIN=gcc
else
export MACOSX_DEPLOYMENT_TARGET=12.0
fi
cd thirdparty
./build-thirdparty.sh -j "$(nproc)"
kernel="$(uname -s | awk '{print tolower($0)}')"
arch="$(uname -m)"
rm -rf "doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz"
tar -cf - installed | xz -z -T0 - >"doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz"
gh release upload --clobber "${tag_name}" "doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz"
success:
name: Success
needs: [prerelease, build]
if: needs.prerelease.outputs.should_release == 'true'
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Update Checksums
run: |
tag_name='automation-1.2-lts'
gh release download "${tag_name}"
content="$(gh release view "${tag_name}" | sed -n '/Update Time:/,/Doris Version:/p')"
echo -ne "${content}\nStatus: *SUCCESS*\n\n## SHA256 Checksums\n\`\`\`\n$(sha256sum *)\n\`\`\`" >release_note.md
gh release edit -F release_note.md "${tag_name}"
failure:
name: Failure
needs: [build]
if: failure()
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Update Checksums
run: |
tag_name='automation-1.2-lts'
gh release download "${tag_name}"
echo -ne "Status: *FAILURE*\n\n## SHA256 Checksums\n\`\`\`\n$(sha256sum *)\n\`\`\`" >release_note.md
gh release edit -F release_note.md "${tag_name}"