-
Notifications
You must be signed in to change notification settings - Fork 4
194 lines (163 loc) · 5.79 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
name: build
on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:
# allow run workflow manually from a commit
# might useful to test pull request in OpenMLDB which changes third-party files
workflow_dispatch:
inputs:
OPENMLDB_REPO:
description: OpenMLDB repo url going to fetch, can be a fork
required: true
default: 4paradigm/OpenMLDB
type: string
OPENMLDB_REF:
description: specific commit/tag SHA
required: true
type: string
UPLOAD:
description: upload the built artifact for testing
default: false
type: boolean
env:
OPENMLDB_REPO: 4paradigm/OpenMLDB
OPENMLDB_REF: cdaf3114904620f5b7a83e3902364eb0f68b91db
jobs:
thirdparty-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- container: ghcr.io/aceforeverd/hybridsql-base:0.4.0
flags: ""
distro: centos
- container: ubuntu:20.04
flags: -DBUILD_ZOOKEEPER_PATCH=ON
distro: ubuntu
container:
image: ${{ matrix.container }}
env:
MAKEOPTS: -j2
DISTRO: ${{ matrix.distro }}
steps:
- uses: actions/checkout@v2
- name: setup deps
if: startsWith(matrix.container, 'ubuntu')
run: |
apt update
DEBIAN_FRONTEND=noninteractive apt-get install -y bison python3-dev libcppunit-dev build-essential cmake autoconf tcl pkg-config git curl patch libtool-bin
- name: setup deps(centos)
if: startsWith(matrix.container, 'ghcr')
run: |
yum install -y patch
- name: download thirdparty source
uses: actions/checkout@v2
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
repository: ${{ env.OPENMLDB_REPO }}
ref: ${{ env.OPENMLDB_REF }}
path: openmldb
- name: download thirdparty source (workflow_dispatch)
uses: actions/checkout@v2
if: github.event_name == 'workflow_dispatch'
with:
repository: ${{ github.event.inputs.OPENMLDB_REPO }}
ref: ${{ github.event.inputs.OPENMLDB_REF }}
path: openmldb
- name: configure
run: |
cmake -S openmldb/third-party -B deps -DBUILD_BUNDLED=ON -DWITH_ZETASQL=OFF ${{ env.flags }}
- name: build
run: |
cmake --build deps
- name: create archive
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.UPLOAD == true)
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
VERSION=${VERSION#v}
./pack_all.sh -i deps -n "$VERSION"
- name: Upload Artifact
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.UPLOAD == true)
uses: actions/upload-artifact@v2
with:
path: deps/thirdparty-*.tar.gz
thirdparty-darwin:
runs-on: macos-12
env:
MAKEOPTS: -j3
steps:
- uses: actions/checkout@v4
# xcode 14.0.1 comes with macOS SDK 12.3, ref https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#installed-sdks
# so pre-compile zetasql requires macOS >= 12.3
- name: Xcode Select Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.0.1'
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: "3.20.x"
- name: download thirdparty source
uses: actions/checkout@v4
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
repository: ${{ env.OPENMLDB_REPO }}
ref: ${{ env.OPENMLDB_REF }}
path: openmldb
- name: download thirdparty source (workflow_dispatch)
uses: actions/checkout@v4
if: github.event_name == 'workflow_dispatch'
with:
repository: ${{ github.event.inputs.OPENMLDB_REPO }}
ref: ${{ github.event.inputs.OPENMLDB_REF }}
path: openmldb
- name: Install System Dependencies
# coreutils for nproc
# gnu-getopt for brpc
run: |
brew install automake coreutils gnu-getopt
- name: configure
run: |
cmake -S openmldb/third-party -B deps -DBUILD_BUNDLED=ON -DWITH_ZETASQL=OFF ${{ env.flags }}
- name: build
run: |
cmake --build deps
- name: verbose minos info
run: |
otool -l deps/usr/lib/libabsl_base.a | grep -A 20 LC_BUILD_VERSION
- name: create archive
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.UPLOAD == true)
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
VERSION=${VERSION#v}
./pack_all.sh -i deps -n "$VERSION"
- name: Upload Artifact
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.UPLOAD == true)
uses: actions/upload-artifact@v3
with:
path: deps/thirdparty-*.tar.gz
release:
runs-on: ubuntu-latest
needs: ["thirdparty-linux", "thirdparty-darwin"]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: generate signature
working-directory: artifact
run: |
sha256sum third*.tar.gz > SHA256SUM
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
artifact/thirdparty*.tar.gz
artifact/SHA256SUM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}