Skip to content

Commit d442773

Browse files
committed
Merge remote-tracking branch 'origin/v3.0' into plugin-chassis
Picks up the v3.0 fixes that unblock plugin-chassis CI: - 5d702b1 build(test): fix testgalera link after switch to src/SQLite3_Server.cpp — restores -Wl,--allow-multiple-definition, ClickHouse/zstd/lz4 link, and ProxySQL_Admin.cpp recompile under TEST_GALERA. Resolves CI-maketest red on plugin-chassis. - baa5069 introduces test/tap/groups/mysql56-single/ which the CI-mysql56-single-g1 workflow expects. Resolves the missing-infra error. - macOS package upload + init_release race-tolerant grouping + amd64 package workflow expansion + various CI/release cleanups. CI-unit-tests-asan-coverage on plugin-chassis still depends on the v3.0 workflow YAML having libprotobuf-dev in its apt install step (workflow_run loads the YAML from the default branch). That fix is already on plugin-chassis (47ab141) and will land on v3.0 via a separate small PR.
2 parents 47ab141 + 6ef036a commit d442773

223 files changed

Lines changed: 28180 additions & 2301 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: CI-build-macos-macos-13-genai
2+
run-name: '${{ github.ref_name }} ${{ github.workflow }} ${{ github.sha }}'
3+
4+
on:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
checks: write
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref_name }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
init_release:
17+
runs-on: ubuntu-latest
18+
# No concurrency group: GitHub's "1 running + 1 pending" rule causes
19+
# mass cancellations when many workflows share a group. Instead we
20+
# run all init jobs in parallel and converge via a race-tolerant
21+
# find-or-create loop; all workers deterministically pick the
22+
# lowest-id draft matching this SHA+tag.
23+
outputs:
24+
release_id: ${{ steps.release.outputs.release_id }}
25+
release_name: ${{ steps.release.outputs.release_name }}
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
repository: ${{ github.repository }}
31+
ref: ${{ github.sha }}
32+
fetch-depth: 0
33+
34+
- name: Find or create draft release
35+
id: release
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
run: |
39+
set -euo pipefail
40+
GIT_DESC=$(git describe --long --abbrev=7 --tags)
41+
TAG_NAME="${{ github.ref_name }}-head"
42+
RELEASE_NAME="${TAG_NAME} - ${GIT_DESC}"
43+
REPO="${{ github.repository }}"
44+
SHA="${{ github.sha }}"
45+
echo "Target: $RELEASE_NAME (sha $SHA)"
46+
47+
sleep $(( RANDOM % 10 ))
48+
49+
RELEASE_ID=""
50+
for attempt in 1 2 3 4 5 6; do
51+
IDS=$(gh api "repos/${REPO}/releases" --paginate \
52+
--jq ".[] | select(.draft==true and .target_commitish==\"${SHA}\" and .tag_name==\"${TAG_NAME}\") | .id" \
53+
| sort -n)
54+
if [ -n "$IDS" ]; then
55+
RELEASE_ID=$(echo "$IDS" | head -1)
56+
NDUPES=$(echo "$IDS" | wc -l)
57+
echo "attempt ${attempt}: found ${NDUPES} draft(s); using lowest id=${RELEASE_ID}"
58+
break
59+
fi
60+
echo "attempt ${attempt}: no matching draft; creating"
61+
gh api -X POST "repos/${REPO}/releases" \
62+
-f tag_name="${TAG_NAME}" \
63+
-f name="${RELEASE_NAME}" \
64+
-f target_commitish="${SHA}" \
65+
-F draft=true -F prerelease=true >/dev/null 2>&1 || true
66+
sleep $(( (RANDOM % 4) + 2 ))
67+
done
68+
69+
if [ -z "$RELEASE_ID" ]; then
70+
echo "ERROR: could not find or create draft release after retries" >&2
71+
exit 1
72+
fi
73+
74+
echo "release_id=${RELEASE_ID}" >> "$GITHUB_OUTPUT"
75+
echo "release_name=${RELEASE_NAME}" >> "$GITHUB_OUTPUT"
76+
77+
build:
78+
needs: init_release
79+
runs-on: macos-13
80+
env:
81+
ARCH: x86_64
82+
MATRIX: '(macos-x86_64-genai)'
83+
BRANCH: ${{ github.ref_name }}
84+
RELEASE_ID: ${{ needs.init_release.outputs.release_id }}
85+
PROXYSQL31: "0"
86+
PROXYSQLGENAI: "1"
87+
PKG_CONFIG_PATH: "/usr/local/opt/openssl@3/lib/pkgconfig"
88+
OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3"
89+
90+
steps:
91+
- uses: LouisBrunner/checks-action@v2.0.0
92+
id: checks
93+
if: always()
94+
with:
95+
token: ${{ secrets.GITHUB_TOKEN }}
96+
name: '${{ github.workflow }} / ${{ github.job }} ${{ env.MATRIX }}'
97+
repo: ${{ github.repository }}
98+
sha: ${{ github.sha }}
99+
status: 'in_progress'
100+
details_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
101+
102+
- name: Install dependencies
103+
run: |
104+
brew install automake bzip2 cmake gpatch gnutls libtool openssl@3 icu4c pkg-config libiconv zlib
105+
106+
- name: Checkout repository
107+
uses: actions/checkout@v4
108+
with:
109+
repository: ${{ github.repository }}
110+
ref: ${{ github.sha }}
111+
fetch-depth: 0
112+
113+
- name: Build ProxySQL
114+
run: |
115+
export PATH="/usr/local/bin:$PATH"
116+
PROXYSQLGENAI=1 make -j$(sysctl -n hw.ncpu)
117+
118+
- name: Package binary
119+
run: |
120+
set -euo pipefail
121+
# Mirror Makefile tier-version bump so tarball matches the built binary's version.
122+
BASE=$(git describe --long --abbrev=7 --tags | sed 's/^v//')
123+
if [ "${PROXYSQLGENAI:-0}" = "1" ]; then
124+
VERSION=$(echo "$BASE" | awk -F. '{printf "%d.%s", $1+1, substr($0, length($1)+2)}')
125+
elif [ "${PROXYSQL31:-0}" = "1" ]; then
126+
VERSION=$(echo "$BASE" | awk -F. '{printf "%s.%d.%s", $1, $2+1, substr($0, length($1)+length($2)+3)}')
127+
else
128+
VERSION="$BASE"
129+
fi
130+
echo "Packaging as version: $VERSION"
131+
tar -C src -czf proxysql-${VERSION}-macos-x86_64.tar.gz proxysql
132+
shasum -a 256 proxysql-${VERSION}-macos-x86_64.tar.gz > proxysql-${VERSION}-macos-x86_64.tar.gz.sha256
133+
134+
- name: Upload to release
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
run: |
138+
set -euo pipefail
139+
shopt -s nullglob
140+
uploaded=0
141+
for f in proxysql-*-macos-x86_64.tar.gz proxysql-*-macos-x86_64.tar.gz.sha256; do
142+
FNAME=$(basename "$f")
143+
EXISTING=$(gh api "repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" \
144+
--jq ".[] | select(.name==\"${FNAME}\") | .id" | head -1)
145+
if [ -n "$EXISTING" ]; then
146+
echo "Replacing existing asset ${FNAME} (id=${EXISTING})"
147+
gh api -X DELETE "repos/${{ github.repository }}/releases/assets/${EXISTING}"
148+
fi
149+
echo "Uploading ${FNAME}"
150+
gh api --method POST \
151+
"https://uploads.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets?name=${FNAME}" \
152+
--header "Content-Type: application/octet-stream" \
153+
--input "$f"
154+
uploaded=$((uploaded+1))
155+
done
156+
if [ "$uploaded" -eq 0 ]; then
157+
echo "ERROR: no macOS tarballs matched proxysql-*-macos-x86_64.tar.gz[.sha256]" >&2
158+
ls -la || true
159+
exit 1
160+
fi
161+
echo "Uploaded $uploaded asset(s) to release id=${RELEASE_ID}"
162+
163+
- uses: LouisBrunner/checks-action@v2.0.0
164+
if: always()
165+
with:
166+
token: ${{ secrets.GITHUB_TOKEN }}
167+
check_id: ${{ steps.checks.outputs.check_id }}
168+
repo: ${{ github.repository }}
169+
sha: ${{ github.sha }}
170+
conclusion: ${{ job.status }}
171+
details_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: CI-build-macos-macos-13-v31
2+
run-name: '${{ github.ref_name }} ${{ github.workflow }} ${{ github.sha }}'
3+
4+
on:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
checks: write
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref_name }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
init_release:
17+
runs-on: ubuntu-latest
18+
# No concurrency group: GitHub's "1 running + 1 pending" rule causes
19+
# mass cancellations when many workflows share a group. Instead we
20+
# run all init jobs in parallel and converge via a race-tolerant
21+
# find-or-create loop; all workers deterministically pick the
22+
# lowest-id draft matching this SHA+tag.
23+
outputs:
24+
release_id: ${{ steps.release.outputs.release_id }}
25+
release_name: ${{ steps.release.outputs.release_name }}
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
repository: ${{ github.repository }}
31+
ref: ${{ github.sha }}
32+
fetch-depth: 0
33+
34+
- name: Find or create draft release
35+
id: release
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
run: |
39+
set -euo pipefail
40+
GIT_DESC=$(git describe --long --abbrev=7 --tags)
41+
TAG_NAME="${{ github.ref_name }}-head"
42+
RELEASE_NAME="${TAG_NAME} - ${GIT_DESC}"
43+
REPO="${{ github.repository }}"
44+
SHA="${{ github.sha }}"
45+
echo "Target: $RELEASE_NAME (sha $SHA)"
46+
47+
sleep $(( RANDOM % 10 ))
48+
49+
RELEASE_ID=""
50+
for attempt in 1 2 3 4 5 6; do
51+
IDS=$(gh api "repos/${REPO}/releases" --paginate \
52+
--jq ".[] | select(.draft==true and .target_commitish==\"${SHA}\" and .tag_name==\"${TAG_NAME}\") | .id" \
53+
| sort -n)
54+
if [ -n "$IDS" ]; then
55+
RELEASE_ID=$(echo "$IDS" | head -1)
56+
NDUPES=$(echo "$IDS" | wc -l)
57+
echo "attempt ${attempt}: found ${NDUPES} draft(s); using lowest id=${RELEASE_ID}"
58+
break
59+
fi
60+
echo "attempt ${attempt}: no matching draft; creating"
61+
gh api -X POST "repos/${REPO}/releases" \
62+
-f tag_name="${TAG_NAME}" \
63+
-f name="${RELEASE_NAME}" \
64+
-f target_commitish="${SHA}" \
65+
-F draft=true -F prerelease=true >/dev/null 2>&1 || true
66+
sleep $(( (RANDOM % 4) + 2 ))
67+
done
68+
69+
if [ -z "$RELEASE_ID" ]; then
70+
echo "ERROR: could not find or create draft release after retries" >&2
71+
exit 1
72+
fi
73+
74+
echo "release_id=${RELEASE_ID}" >> "$GITHUB_OUTPUT"
75+
echo "release_name=${RELEASE_NAME}" >> "$GITHUB_OUTPUT"
76+
77+
build:
78+
needs: init_release
79+
runs-on: macos-13
80+
env:
81+
ARCH: x86_64
82+
MATRIX: '(macos-x86_64-v31)'
83+
BRANCH: ${{ github.ref_name }}
84+
RELEASE_ID: ${{ needs.init_release.outputs.release_id }}
85+
PROXYSQL31: "1"
86+
PROXYSQLGENAI: "0"
87+
PKG_CONFIG_PATH: "/usr/local/opt/openssl@3/lib/pkgconfig"
88+
OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3"
89+
90+
steps:
91+
- uses: LouisBrunner/checks-action@v2.0.0
92+
id: checks
93+
if: always()
94+
with:
95+
token: ${{ secrets.GITHUB_TOKEN }}
96+
name: '${{ github.workflow }} / ${{ github.job }} ${{ env.MATRIX }}'
97+
repo: ${{ github.repository }}
98+
sha: ${{ github.sha }}
99+
status: 'in_progress'
100+
details_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
101+
102+
- name: Install dependencies
103+
run: |
104+
brew install automake bzip2 cmake gpatch gnutls libtool openssl@3 icu4c pkg-config libiconv zlib
105+
106+
- name: Checkout repository
107+
uses: actions/checkout@v4
108+
with:
109+
repository: ${{ github.repository }}
110+
ref: ${{ github.sha }}
111+
fetch-depth: 0
112+
113+
- name: Build ProxySQL
114+
run: |
115+
export PATH="/usr/local/bin:$PATH"
116+
PROXYSQL31=1 make -j$(sysctl -n hw.ncpu)
117+
118+
- name: Package binary
119+
run: |
120+
set -euo pipefail
121+
# Mirror Makefile tier-version bump so tarball matches the built binary's version.
122+
BASE=$(git describe --long --abbrev=7 --tags | sed 's/^v//')
123+
if [ "${PROXYSQLGENAI:-0}" = "1" ]; then
124+
VERSION=$(echo "$BASE" | awk -F. '{printf "%d.%s", $1+1, substr($0, length($1)+2)}')
125+
elif [ "${PROXYSQL31:-0}" = "1" ]; then
126+
VERSION=$(echo "$BASE" | awk -F. '{printf "%s.%d.%s", $1, $2+1, substr($0, length($1)+length($2)+3)}')
127+
else
128+
VERSION="$BASE"
129+
fi
130+
echo "Packaging as version: $VERSION"
131+
tar -C src -czf proxysql-${VERSION}-macos-x86_64.tar.gz proxysql
132+
shasum -a 256 proxysql-${VERSION}-macos-x86_64.tar.gz > proxysql-${VERSION}-macos-x86_64.tar.gz.sha256
133+
134+
- name: Upload to release
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
run: |
138+
set -euo pipefail
139+
shopt -s nullglob
140+
uploaded=0
141+
for f in proxysql-*-macos-x86_64.tar.gz proxysql-*-macos-x86_64.tar.gz.sha256; do
142+
FNAME=$(basename "$f")
143+
EXISTING=$(gh api "repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" \
144+
--jq ".[] | select(.name==\"${FNAME}\") | .id" | head -1)
145+
if [ -n "$EXISTING" ]; then
146+
echo "Replacing existing asset ${FNAME} (id=${EXISTING})"
147+
gh api -X DELETE "repos/${{ github.repository }}/releases/assets/${EXISTING}"
148+
fi
149+
echo "Uploading ${FNAME}"
150+
gh api --method POST \
151+
"https://uploads.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets?name=${FNAME}" \
152+
--header "Content-Type: application/octet-stream" \
153+
--input "$f"
154+
uploaded=$((uploaded+1))
155+
done
156+
if [ "$uploaded" -eq 0 ]; then
157+
echo "ERROR: no macOS tarballs matched proxysql-*-macos-x86_64.tar.gz[.sha256]" >&2
158+
ls -la || true
159+
exit 1
160+
fi
161+
echo "Uploaded $uploaded asset(s) to release id=${RELEASE_ID}"
162+
163+
- uses: LouisBrunner/checks-action@v2.0.0
164+
if: always()
165+
with:
166+
token: ${{ secrets.GITHUB_TOKEN }}
167+
check_id: ${{ steps.checks.outputs.check_id }}
168+
repo: ${{ github.repository }}
169+
sha: ${{ github.sha }}
170+
conclusion: ${{ job.status }}
171+
details_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'

0 commit comments

Comments
 (0)