Skip to content

Commit a3ebee0

Browse files
kounelisagisypatia
andauthored
Create a reusable workflow for building artifacts (#5691)
This PR extracts the artifact build logic from the release workflow and turns it into a new standalone reusable workflow. The goal is to make it easier for external repositories, such as TileDB-Py, to request builds from arbitrary branches and consume the resulting artifacts, without triggering any release processes in Core. By centralizing the workflow, we eliminate the need for each repo to maintain its own -duplicate- build steps and replace the previous ad-hoc or local builds that were sometimes used to validate downstream changes with a consistent process. Do you believe we also need `workflow_dispatch` for testing? Example of the workflow triggered by a TileDB-Py workflow https://github.com/TileDB-Inc/TileDB-Py/actions/runs/19416273843 Closes CORE-431 --- TYPE: IMPROVEMENT DESC: Create a reusable workflow for building artifacts. Co-authored-by: Ypatia Tsavliri <[email protected]>
1 parent c107c6e commit a3ebee0

File tree

2 files changed

+127
-91
lines changed

2 files changed

+127
-91
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Build TileDB Artifacts
2+
3+
# This is a minimal workflow specifically for external repositories (TileDB-Py, etc.)
4+
# to build TileDB artifacts from any branch without triggering release processes.
5+
#
6+
# For actual Core releases, use release.yml instead.
7+
8+
on:
9+
workflow_call:
10+
inputs:
11+
ref:
12+
description: 'Git ref (branch, tag, or commit SHA) to build from'
13+
required: false
14+
default: ''
15+
type: string
16+
version:
17+
description: 'Version string for the build (defaults to ref-shortsha if not provided)'
18+
required: false
19+
type: string
20+
default: ''
21+
22+
jobs:
23+
Package-Binary-Release:
24+
name: Build TileDB - ${{ matrix.platform }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
include:
29+
- platform: windows-x86_64
30+
os: windows-2022
31+
triplet: x64-windows-release
32+
# We can safely use the latest image, since the real job will run in the manylinux container.
33+
- platform: linux-x86_64
34+
os: ubuntu-latest
35+
manylinux: quay.io/pypa/manylinux_2_28_x86_64
36+
triplet: x64-linux-release
37+
- platform: linux-x86_64-noavx2
38+
os: ubuntu-latest
39+
cmake_args: -DCOMPILER_SUPPORTS_AVX2=OFF
40+
triplet: x64-linux-release
41+
manylinux: quay.io/pypa/manylinux_2_28_x86_64
42+
- platform: linux-aarch64
43+
os: ubuntu-24.04-arm
44+
triplet: arm64-linux-release
45+
manylinux: quay.io/pypa/manylinux_2_28_aarch64
46+
- platform: macos-x86_64
47+
os: macos-latest
48+
cmake_args: -DCMAKE_OSX_ARCHITECTURES=x86_64
49+
MACOSX_DEPLOYMENT_TARGET: 11
50+
triplet: x64-osx-release
51+
- platform: macos-arm64
52+
os: macos-latest
53+
cmake_args: -DCMAKE_OSX_ARCHITECTURES=arm64
54+
MACOSX_DEPLOYMENT_TARGET: 11
55+
triplet: arm64-osx-release
56+
runs-on: ${{ matrix.os }}
57+
container: ${{ matrix.manylinux || '' }}
58+
env:
59+
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.MACOSX_DEPLOYMENT_TARGET }}
60+
61+
steps:
62+
- name: Checkout TileDB
63+
# v4 uses node 20 which is incompatible with the libc version of the manylinux image
64+
uses: actions/checkout@v3
65+
with:
66+
repository: TileDB-Inc/TileDB
67+
ref: ${{ inputs.ref || github.ref }}
68+
- name: 'Homebrew and SDKROOT setup on macOS'
69+
run: |
70+
brew install automake ninja
71+
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
72+
if: ${{ startsWith(matrix.os, 'macos-') == true }}
73+
- name: Set variables
74+
id: get-values
75+
run: |
76+
if [ -n "${{ inputs.version }}" ]; then
77+
VERSION="${{ inputs.version }}"
78+
else
79+
release_hash=$( echo ${{ github.sha }} | cut -c-7 - )
80+
ref=${{ github.head_ref || github.ref_name }}
81+
VERSION="${ref##*/}-$release_hash"
82+
fi
83+
echo "release_version=$VERSION" >> $GITHUB_OUTPUT
84+
shell: bash
85+
- name: Install manylinux prerequisites
86+
if: ${{ startsWith(matrix.platform, 'linux') == true }}
87+
run: |
88+
set -e pipefail
89+
yum install -y ninja-build perl-IPC-Cmd perl-Time-Piece curl zip unzip tar
90+
echo "VCPKG_FORCE_SYSTEM_BINARIES=YES" >> $GITHUB_ENV
91+
- name: Configure TileDB
92+
run: |
93+
cmake -S . -B build \
94+
-DCMAKE_BUILD_TYPE=Release \
95+
-DBUILD_SHARED_LIBS=ON \
96+
-DCMAKE_INSTALL_PREFIX=./dist \
97+
-DTILEDB_INSTALL_LIBDIR=lib \
98+
-DTILEDB_S3=ON \
99+
-DTILEDB_AZURE=ON \
100+
-DTILEDB_GCS=ON \
101+
-DTILEDB_SERIALIZATION=ON \
102+
-DTILEDB_WEBP=ON \
103+
-DTILEDB_TESTS=OFF \
104+
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
105+
${{ matrix.cmake_args }}
106+
shell: bash
107+
- name: Build TileDB
108+
env:
109+
TILEDB_PACKAGE_VERSION: ${{ steps.get-values.outputs.release_version }}
110+
run: cmake --build build -j4 --config Release --target package
111+
- name: Upload release artifacts
112+
uses: actions/upload-artifact@v4
113+
with:
114+
name: release-${{ matrix.platform }}
115+
path: |
116+
build/tiledb-*.tar.gz*
117+
build/tiledb-*.zip*
118+
- name: "Print log files (failed build only)"
119+
shell: bash
120+
run: |
121+
source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
122+
if: failure() # only run this job if the build step failed

.github/workflows/release.yml

Lines changed: 5 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -39,97 +39,11 @@ jobs:
3939
build/tiledb-*
4040
4141
Package-Binary-Release:
42-
name: Package Binary Release - ${{ matrix.platform }}
43-
strategy:
44-
fail-fast: false
45-
matrix:
46-
include:
47-
- platform: windows-x86_64
48-
os: windows-2022
49-
triplet: x64-windows-release
50-
# We can safely use the latest image, since the real job will run in the manylinux container.
51-
- platform: linux-x86_64
52-
os: ubuntu-latest
53-
manylinux: quay.io/pypa/manylinux_2_28_x86_64
54-
triplet: x64-linux-release
55-
- platform: linux-x86_64-noavx2
56-
os: ubuntu-latest
57-
cmake_args: -DCOMPILER_SUPPORTS_AVX2=OFF
58-
triplet: x64-linux-release
59-
manylinux: quay.io/pypa/manylinux_2_28_x86_64
60-
- platform: linux-aarch64
61-
os: ubuntu-24.04-arm
62-
triplet: arm64-linux-release
63-
manylinux: quay.io/pypa/manylinux_2_28_aarch64
64-
- platform: macos-x86_64
65-
os: macos-latest
66-
cmake_args: -DCMAKE_OSX_ARCHITECTURES=x86_64
67-
MACOSX_DEPLOYMENT_TARGET: 11
68-
triplet: x64-osx-release
69-
- platform: macos-arm64
70-
os: macos-latest
71-
cmake_args: -DCMAKE_OSX_ARCHITECTURES=arm64
72-
MACOSX_DEPLOYMENT_TARGET: 11
73-
triplet: arm64-osx-release
74-
runs-on: ${{ matrix.os }}
75-
container: ${{ matrix.manylinux || '' }}
76-
env:
77-
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.MACOSX_DEPLOYMENT_TARGET }}
78-
79-
steps:
80-
- name: Checkout TileDB
81-
# v4 uses node 20 which is incompatible with the libc version of the manylinux image
82-
uses: actions/checkout@v3
83-
- name: 'Homebrew and SDKROOT setup on macOS'
84-
run: |
85-
brew install automake ninja
86-
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
87-
if: ${{ startsWith(matrix.os, 'macos-') == true }}
88-
- name: Set variables
89-
id: get-values
90-
run: |
91-
release_hash=$( echo ${{ github.sha }} | cut -c-7 - )
92-
ref=${{ github.head_ref || github.ref_name }}
93-
echo "release_version=${ref##*/}-$release_hash" >> $GITHUB_OUTPUT
94-
shell: bash
95-
- name: Install manylinux prerequisites
96-
if: ${{ startsWith(matrix.platform, 'linux') == true }}
97-
run: |
98-
set -e pipefail
99-
yum install -y ninja-build perl-IPC-Cmd perl-Time-Piece curl zip unzip tar
100-
echo "VCPKG_FORCE_SYSTEM_BINARIES=YES" >> $GITHUB_ENV
101-
- name: Configure TileDB
102-
run: |
103-
cmake -S . -B build \
104-
-DCMAKE_BUILD_TYPE=Release \
105-
-DBUILD_SHARED_LIBS=ON \
106-
-DCMAKE_INSTALL_PREFIX=./dist \
107-
-DTILEDB_INSTALL_LIBDIR=lib \
108-
-DTILEDB_S3=ON \
109-
-DTILEDB_AZURE=ON \
110-
-DTILEDB_GCS=ON \
111-
-DTILEDB_SERIALIZATION=ON \
112-
-DTILEDB_WEBP=ON \
113-
-DTILEDB_TESTS=OFF \
114-
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
115-
${{ matrix.cmake_args }}
116-
shell: bash
117-
- name: Build TileDB
118-
env:
119-
TILEDB_PACKAGE_VERSION: ${{ steps.get-values.outputs.release_version }}
120-
run: cmake --build build -j4 --config Release --target package
121-
- name: Upload release artifacts
122-
uses: actions/upload-artifact@v4
123-
with:
124-
name: release-${{ matrix.platform }}
125-
path: |
126-
build/tiledb-*.tar.gz*
127-
build/tiledb-*.zip*
128-
- name: "Print log files (failed build only)"
129-
shell: bash
130-
run: |
131-
source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
132-
if: failure() # only run this job if the build step failed
42+
name: Build TileDB Binaries
43+
uses: ./.github/workflows/build-artifacts.yml
44+
with:
45+
ref: ${{ github.ref }}
46+
version: ''
13347

13448
Build-R-Binaries:
13549
uses: ./.github/workflows/build-rtools40.yml

0 commit comments

Comments
 (0)