12
12
cibw_prerelease_pythons :
13
13
required : false
14
14
type : string
15
+ library_version :
16
+ required : false
17
+ type : string
15
18
16
19
jobs :
20
+ compute_version :
21
+ name : Compute Library Version
22
+ runs-on : ubuntu-latest
23
+ outputs :
24
+ library_version : ${{ steps.compute-version.outputs.library_version }}
25
+ steps :
26
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27
+ # Include all history and tags
28
+ with :
29
+ persist-credentials : false
30
+ fetch-depth : 0
31
+ - uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
32
+ name : Install Python
33
+ with :
34
+ python-version : ' 3.12'
35
+ - name : Compute Version
36
+ id : compute-version
37
+ run : |
38
+ if [ -n "${{ inputs.library_version}}" ]; then
39
+ LIBRARY_VERSION="${{ inputs.library_version}}"
40
+ else
41
+ pip install "setuptools_scm[toml]>=4"
42
+ LIBRARY_VERSION=$(setuptools-scm)
43
+ fi
44
+
45
+ echo "${LIBRARY_VERSION}"
46
+ echo "library_version=${LIBRARY_VERSION}" >> $GITHUB_OUTPUT
47
+
17
48
build-wheels-matrix :
18
49
runs-on : ubuntu-latest
19
50
outputs :
@@ -32,26 +63,27 @@ jobs:
32
63
run : |
33
64
MATRIX_INCLUDE=$(
34
65
{
35
- cibuildwheel --print-build-identifiers --platform linux --archs x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest"}' \
36
- && cibuildwheel --print-build-identifiers --platform linux --archs aarch64 | jq -cR '{only: ., os: "ubuntu-24.04-arm "}' \
66
+ cibuildwheel --print-build-identifiers --platform linux --archs x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest-16-cores "}' \
67
+ && cibuildwheel --print-build-identifiers --platform linux --archs aarch64 | jq -cR '{only: ., os: "arm-8core-linux "}' \
37
68
&& cibuildwheel --print-build-identifiers --platform windows --archs AMD64,x86 | jq -cR '{only: ., os: "windows-latest"}' \
38
69
&& cibuildwheel --print-build-identifiers --platform windows --archs ARM64 | jq -cR '{only: ., os: "windows-11-arm"}' \
39
- && cibuildwheel --print-build-identifiers --platform macos --archs x86_64 | jq -cR '{only: ., os: "macos-13 "}' \
40
- && cibuildwheel --print-build-identifiers --platform macos --archs arm64 | jq -cR '{only: ., os: "macos-latest "}'
70
+ && cibuildwheel --print-build-identifiers --platform macos --archs x86_64 | jq -cR '{only: ., os: "macos-15-large "}' \
71
+ && cibuildwheel --print-build-identifiers --platform macos --archs arm64 | jq -cR '{only: ., os: "macos-15-xlarge "}'
41
72
} | jq -sc
42
73
)
43
74
echo $MATRIX_INCLUDE
44
75
echo "include=${MATRIX_INCLUDE}" >> $GITHUB_OUTPUT
45
76
46
77
build :
47
- needs : build-wheels-matrix
78
+ needs : ["compute_version", " build-wheels-matrix" ]
48
79
runs-on : ${{ matrix.os }}
49
80
name : Build ${{ matrix.only }}
50
81
strategy :
51
82
fail-fast : false
52
83
matrix :
53
84
include : ${{ fromJson(needs.build-wheels-matrix.outputs.include) }}
54
85
env :
86
+ SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DDTRACE : ${{ needs.compute_version.outputs.library_version }}
55
87
CIBW_SKIP : ${{ inputs.cibw_skip }}
56
88
CIBW_PRERELEASE_PYTHONS : ${{ inputs.cibw_prerelease_pythons }}
57
89
CIBW_MANYLINUX_X86_64_IMAGE : manylinux2014
@@ -66,11 +98,12 @@ jobs:
66
98
fi
67
99
curl -sSf https://sh.rustup.rs | sh -s -- -y;
68
100
fi
69
- CIBW_ENVIRONMENT_LINUX : PATH=$HOME/.cargo/bin:$PATH CMAKE_BUILD_PARALLEL_LEVEL=24 CMAKE_ARGS="-DNATIVE_TESTING=OFF"
101
+ CIBW_ENVIRONMENT_LINUX : PATH=$HOME/.cargo/bin:$PATH CMAKE_BUILD_PARALLEL_LEVEL=24 CMAKE_ARGS="-DNATIVE_TESTING=OFF" SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DDTRACE=${{ needs.compute_version.outputs.library_version }}
70
102
# SYSTEM_VERSION_COMPAT is a workaround for versioning issue, a.k.a.
71
103
# `platform.mac_ver()` reports incorrect MacOS version at 11.0
72
104
# See: https://stackoverflow.com/a/65402241
73
- CIBW_ENVIRONMENT_MACOS : CMAKE_BUILD_PARALLEL_LEVEL=24 SYSTEM_VERSION_COMPAT=0 CMAKE_ARGS="-DNATIVE_TESTING=OFF"
105
+ CIBW_ENVIRONMENT_MACOS : CMAKE_BUILD_PARALLEL_LEVEL=24 SYSTEM_VERSION_COMPAT=0 CMAKE_ARGS="-DNATIVE_TESTING=OFF" SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DDTRACE=${{ needs.compute_version.outputs.library_version }}
106
+ CIBW_ENVIRONMENT_WINDOWS : SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DDTRACE=${{ needs.compute_version.outputs.library_version }}
74
107
# cibuildwheel repair will copy anything's under /output directory from the
75
108
# build container to the host machine. This is a bit hacky way, but seems
76
109
# to be the only way getting debug symbols out from the container while
0 commit comments