Skip to content

Commit 3c92d79

Browse files
ci: python cibuildwheel updates for go-jsonnet
- Checkout with submodules, otherwise the sdist won't include libjsonnet.h - Install golang in the cibuildwheel build container. - Skip musllinux build; it's not working for me. - Skip Windows platform builds; they're not working for me. It would be nice to get the other platforms working but I have already spent hours on this and haven't succeeded yet. Previous go-jsonnet releases on PyPI didn't have prebuilt wheel packages anyway, so it's still strictly better to have some rather than none even if not all platforms are covered.
1 parent e9ee116 commit 3c92d79

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

.github/workflows/install-go.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/bash
2+
3+
# Helper script to install Go dev tools.
4+
# This is run _inside_ the manylinux container(s)
5+
# used in cibuildwheel to build the wheels.
6+
7+
set -euo pipefail
8+
9+
TDIR="$(mktemp -d)"
10+
>&2 echo "Working dir: ${TDIR}"
11+
trap "rm -rf ${TDIR}" EXIT
12+
13+
>&2 echo "Downloading Go 1.23.6 distribution file."
14+
curl -fL -o "${TDIR}/go1.23.6.linux-amd64.tar.gz" 'https://go.dev/dl/go1.23.6.linux-amd64.tar.gz'
15+
16+
>&2 echo "Checking distribution file integrity"
17+
GO_DIST_SHA256='9379441ea310de000f33a4dc767bd966e72ab2826270e038e78b2c53c2e7802d'
18+
printf '%s %s/go1.23.6.linux-amd64.tar.gz\n' "${GO_DIST_SHA256}" "${TDIR}" | sha256sum -c
19+
20+
>&2 echo "Unpacking to /usr/local/go"
21+
rm -rf /usr/local/go && tar -C /usr/local -xzf "${TDIR}/go1.23.6.linux-amd64.tar.gz"
22+
23+
>&2 echo "Installed Go version:"
24+
/usr/local/go/bin/go version

.github/workflows/publish-python.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929

3030
steps:
3131
- uses: actions/checkout@v4
32+
with:
33+
submodules: true
3234

3335
- uses: actions/setup-python@v5
3436
with:
@@ -50,22 +52,29 @@ jobs:
5052
name: Build wheels on ${{ matrix.os }}
5153
runs-on: ${{ matrix.os }}
5254
strategy:
55+
fail-fast: false
5356
matrix:
54-
#os: [ubuntu-22.04, windows-latest, macos-latest]
55-
os: [ubuntu-22.04, windows-latest]
57+
os: [ubuntu-22.04]
5658

5759
permissions:
5860
contents: read
5961

6062
steps:
6163
- uses: actions/checkout@v4
64+
with:
65+
submodules: true
6266

6367
- name: Build wheels
6468
uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0
6569
env:
66-
# Skip PyPy, 32-bit Windows, 32-bit Linux, and CPython before 3.9.
70+
# Skip PyPy, 32-bit Windows, 32-bit Linux, musllinux and CPython before 3.9.
6771
# See https://cibuildwheel.readthedocs.io/en/stable/options/#examples_1
68-
CIBW_SKIP: "*-win32 pp* *-manylinux_i686 *-musllinux_i686 cp36-* cp37-* cp38-*"
72+
CIBW_SKIP: "*-win32 pp* *-manylinux_i686 *-musllinux* cp36-* cp37-* cp38-*"
73+
CIBW_BEFORE_ALL_LINUX: >
74+
bash {package}/.github/workflows/install-go.sh &&
75+
export PATH="$PATH":/usr/local/go/bin &&
76+
command -v go > /dev/null
77+
CIBW_ENVIRONMENT: PATH=$PATH:/usr/local/go/bin
6978
CIBW_TEST_COMMAND: >
7079
python {package}/python/_jsonnet_test.py
7180

0 commit comments

Comments
 (0)