-
Notifications
You must be signed in to change notification settings - Fork 1
196 lines (187 loc) · 7.36 KB
/
Copy pathbuild.yml
File metadata and controls
196 lines (187 loc) · 7.36 KB
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
name: build
# Build the component across an arch matrix and attach the shipping artifacts
# (plus the Pawn include) to GitHub releases.
#
# open.mp servers + components are currently 32-bit (i386), so the 32-bit
# Windows/Linux artifacts are what ship today. The 64-bit jobs are
# FUTURE-PROOFING for a 64-bit open.mp server — they build and upload artifacts
# but are not the canonical release targets yet.
#
# Naming: <os>-<bits> e.g. windows-32, linux-64. macOS has no 32-bit support at
# all (Apple removed it in Catalina), and there is no macOS open.mp server, so
# macOS is a single 64-bit dev build-gate only (never shipped).
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:
jobs:
# =========================================================================
# 32-bit — the current shipping targets
# =========================================================================
# --- Windows 32-bit .dll (MSVC) ------------------------------------------
# Native MSVC (the canonical open.mp component ABI). MariaDB Connector/C
# submodule built from source (OpenSSL TLS, via vcpkg), statically linked ->
# the .dll ships beside the bundled libssl/libcrypto OpenSSL runtime DLLs.
windows-32:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Install OpenSSL (x86) via vcpkg
shell: bash
run: vcpkg install openssl:x86-windows
- name: Configure (Win32 / MSVC, OpenSSL)
shell: bash
run: >
cmake -B build-win32 -A Win32 -DCMAKE_BUILD_TYPE=Release
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_TARGET_TRIPLET=x86-windows
- name: Build
run: cmake --build build-win32 --config Release
- name: Locate artifacts (.dll + bundled OpenSSL runtime DLLs)
shell: bash
run: |
dll=$(find build-win32 -name omp-mysql.dll | head -1)
test -n "$dll"; cp "$dll" omp-mysql.dll
cp "$VCPKG_INSTALLATION_ROOT"/installed/x86-windows/bin/libssl-3*.dll . 2>/dev/null || true
cp "$VCPKG_INSTALLATION_ROOT"/installed/x86-windows/bin/libcrypto-3*.dll . 2>/dev/null || true
ls -la *.dll
- uses: actions/upload-artifact@v4
with:
name: mysql-windows-x86
path: |
omp-mysql.dll
libssl-3*.dll
libcrypto-3*.dll
include/omp-mysql.inc
# --- Linux 32-bit .so -----------------------------------------------------
# i386 Debian bullseye container (glibc 2.31, matching the server); MariaDB
# Connector/C built from source (OpenSSL TLS), statically linked.
linux-32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build 32-bit omp-mysql.so
run: ARCH=32 ./scripts/build-linux.sh
- name: Sanity-check artifact
run: |
test -f build-linux/omp-mysql.so
file build-linux/omp-mysql.so | grep -q "ELF 32-bit"
- uses: actions/upload-artifact@v4
with:
name: mysql-linux-x86
path: |
build-linux/omp-mysql.so
include/omp-mysql.inc
# =========================================================================
# 64-bit — future-proofing (a 64-bit open.mp server is not shipping yet)
# =========================================================================
# --- Windows 64-bit .dll (MSVC) ------------------------------------------
windows-64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install OpenSSL (x64) via vcpkg
shell: bash
run: vcpkg install openssl:x64-windows
- name: Configure (x64 / MSVC, OpenSSL)
shell: bash
run: >
cmake -B build-win64 -A x64 -DCMAKE_BUILD_TYPE=Release
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_TARGET_TRIPLET=x64-windows
- name: Build
run: cmake --build build-win64 --config Release
- name: Locate artifacts (.dll + bundled OpenSSL runtime DLLs)
shell: bash
run: |
dll=$(find build-win64 -name omp-mysql.dll | head -1)
test -n "$dll"; cp "$dll" omp-mysql.dll
cp "$VCPKG_INSTALLATION_ROOT"/installed/x64-windows/bin/libssl-3*.dll . 2>/dev/null || true
cp "$VCPKG_INSTALLATION_ROOT"/installed/x64-windows/bin/libcrypto-3*.dll . 2>/dev/null || true
ls -la *.dll
- uses: actions/upload-artifact@v4
with:
name: mysql-windows-x64
path: |
omp-mysql.dll
libssl-3*.dll
libcrypto-3*.dll
include/omp-mysql.inc
# --- Linux 64-bit .so -----------------------------------------------------
linux-64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build 64-bit omp-mysql.so
run: ARCH=64 ./scripts/build-linux.sh
- name: Sanity-check artifact
run: |
test -f build-linux64/omp-mysql.so
file build-linux64/omp-mysql.so | grep -q "ELF 64-bit"
- uses: actions/upload-artifact@v4
with:
name: mysql-linux-x64
path: |
build-linux64/omp-mysql.so
include/omp-mysql.inc
# --- macOS .dylib (64-bit, dev build-gate only — NOT a shipping target) --
# There is NO macOS open.mp server, so the .dylib is never released, and macOS
# has no 32-bit support at all. This single 64-bit job keeps the macOS dev
# build path from rotting. Uploads no artifact; not a release dependency.
macos-64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install connector build deps (OpenSSL/zstd for MariaDB Connector/C)
run: brew install openssl@3 zstd
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build (sanity only — artifact intentionally not uploaded)
run: cmake --build build --config Release
# =========================================================================
# Release: attach all built artifacts on a tag
# =========================================================================
# Depends only on the 32-bit shipping jobs (today's real targets); the 64-bit
# artifacts are included if their jobs succeeded.
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [windows-32, linux-32]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
- name: Package per-target archives
run: |
cd dist
for d in */; do
name="${d%/}"
(cd "$d" && zip -r "../${name}.zip" .)
done
ls -la
# Attach build artifacts to the tag's release. Won't fail the run if the
# release was already created manually for this tag — it just updates assets.
- uses: softprops/action-gh-release@v2
continue-on-error: true
with:
files: dist/*.zip
generate_release_notes: true