Skip to content

Commit a288ef5

Browse files
Merge pull request #201 from jim-easterbrook/workflow
Workflow
2 parents 2efebf0 + 3cb9e80 commit a288ef5

1 file changed

Lines changed: 37 additions & 42 deletions

File tree

.github/workflows/build-wheels.yml renamed to .github/workflows/build-gphoto2-wheels.yml

Lines changed: 37 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,105 +3,100 @@ on: workflow_dispatch
33

44
jobs:
55
build:
6-
name: build on ${{ matrix.os }}
7-
runs-on: ${{ matrix.os }}
6+
name: build ${{ matrix.build }}
7+
runs-on: ${{ matrix.runner }}
88
strategy:
99
matrix:
10-
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-13, macos-14]
1110
include:
12-
- os: macos-13
13-
target: 13.0
14-
- os: macos-14
11+
- build: Linux-x64
12+
runner: ubuntu-22.04
13+
arch: x86_64
14+
- build: Linux-arm64
15+
runner: ubuntu-22.04-arm
16+
arch: aarch64
17+
- build: MacOS-x64
18+
runner: macos-15-intel
19+
target: 15.0
20+
arch: x86_64
21+
- build: MacOS-arm64
22+
runner: macos-14
1523
dependencies: libtool gd
1624
target: 14.0
25+
arch: arm64
1726
env:
18-
GPHOTO_DIR: ${{ github.workspace }}/libgphoto2
19-
GPHOTO_VSN: 2.5.33
27+
GPHOTO_SRC: https://github.com/gphoto/libgphoto2/releases/download/v2.5.33/libgphoto2-2.5.33.tar.xz
28+
GPHOTO2_ROOT: libgphoto2/local_install
29+
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.target }}
2030
steps:
2131
- name: Check out repository code
2232
uses: actions/checkout@v4
2333

2434
- name: Download libgphoto2
25-
run: wget -nv
26-
https://github.com/gphoto/libgphoto2/releases/download/v${GPHOTO_VSN}/libgphoto2-${GPHOTO_VSN}.tar.xz
27-
-O libgphoto2.tar.xz
28-
29-
- name: Extract libgphoto2
3035
run: |
31-
mkdir $GPHOTO_DIR
32-
tar xf libgphoto2.tar.xz \
33-
--directory $GPHOTO_DIR --strip-components=1
36+
mkdir libgphoto2
37+
wget -nv ${{ env.GPHOTO_SRC }} -O - |
38+
tar --xz -x -f - --directory libgphoto2 --strip-components=1
3439
35-
- name: Build libgphoto2
40+
- name: Build libgphoto2 (MacOS)
3641
if: ${{ runner.os == 'macOS' }}
3742
run: |
3843
brew install libexif ${{ matrix.dependencies }}
39-
cd $GPHOTO_DIR
44+
cd libgphoto2
4045
./configure --prefix=$PWD/local_install --disable-internal-docs \
4146
--enable-vusb \
4247
CFLAGS="-D_DARWIN_C_SOURCE -I$(brew --prefix)/include"
4348
make
4449
make install
4550
4651
- name: Build wheels (Python 3.6 & 3.7)
47-
if: ${{ matrix.os != 'macos-14' }}
52+
if: ${{ runner.os != 'macOS' }}
4853
# cibuildwheel@v3.x omits Python 3.6 & 3.7
4954
uses: pypa/cibuildwheel@v2.23.3
5055
env:
51-
CIBW_ARCHS: auto64
56+
CIBW_ARCHS: ${{ matrix.arch }}
5257
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
5358
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
5459
CIBW_BUILD: "cp36* cp37*"
5560
CIBW_SKIP: "*musllinux*"
56-
CIBW_ENVIRONMENT_LINUX: >
57-
GPHOTO2_ROOT=$PWD/libgphoto2/local_install
58-
CIBW_ENVIRONMENT_MACOS: >
59-
GPHOTO2_ROOT=$GPHOTO_DIR/local_install
60-
MACOSX_DEPLOYMENT_TARGET=${{ matrix.target }}
61-
SYSTEM_VERSION_COMPAT=0
61+
CIBW_ENVIRONMENT_MACOS: SYSTEM_VERSION_COMPAT=0
62+
CIBW_ENVIRONMENT_PASS_LINUX: GPHOTO2_ROOT
6263
CIBW_TEST_COMMAND: >
6364
python3 -m gphoto2 -v &&
6465
python3 -m unittest discover {project}/tests -v
6566
CIBW_BEFORE_ALL_LINUX: >
6667
yum install -y libusbx-devel libexif-devel libjpeg-turbo-devel
6768
gd-devel libcurl-devel libxml2-devel libtool-ltdl-devel &&
68-
pushd $PWD/libgphoto2 &&
69+
cd libgphoto2 &&
6970
./configure --prefix=$PWD/local_install --disable-internal-docs
7071
--enable-vusb &&
7172
make &&
72-
make install &&
73-
popd
73+
make install
7474
7575
- name: Build wheels (Python 3.8+)
76-
uses: pypa/cibuildwheel@v3.2.1
76+
uses: pypa/cibuildwheel@v3.4.0
7777
env:
78-
CIBW_ARCHS: auto64
78+
CIBW_ARCHS: ${{ matrix.arch }}
7979
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
8080
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
8181
CIBW_BUILD: "cp*"
8282
CIBW_SKIP: "*musllinux*"
83-
CIBW_ENVIRONMENT_LINUX: >
84-
GPHOTO2_ROOT=$PWD/libgphoto2/local_install
85-
CIBW_ENVIRONMENT_MACOS: >
86-
GPHOTO2_ROOT=$GPHOTO_DIR/local_install
87-
MACOSX_DEPLOYMENT_TARGET=${{ matrix.target }}
88-
SYSTEM_VERSION_COMPAT=0
83+
CIBW_ENVIRONMENT_MACOS: SYSTEM_VERSION_COMPAT=0
84+
CIBW_ENVIRONMENT_PASS_LINUX: GPHOTO2_ROOT
8985
CIBW_TEST_COMMAND: >
9086
python3 -m gphoto2 -v &&
9187
python3 -m unittest discover {project}/tests -v
9288
CIBW_TEST_SKIP: "cp38-macosx_*:arm64"
9389
CIBW_BEFORE_ALL_LINUX: >
9490
yum install -y libusbx-devel libexif-devel libjpeg-turbo-devel
9591
gd-devel libcurl-devel libxml2-devel libtool-ltdl-devel &&
96-
pushd $PWD/libgphoto2 &&
92+
cd libgphoto2 &&
9793
./configure --prefix=$PWD/local_install --disable-internal-docs
9894
--enable-vusb &&
9995
make &&
100-
make install &&
101-
popd
96+
make install
10297
10398
- name: Store results
104-
uses: actions/upload-artifact@v4
99+
uses: actions/upload-artifact@v6
105100
with:
106-
name: gphoto2-wheels-${{ runner.os }}-${{ runner.arch }}
101+
name: gphoto2-wheels-${{ matrix.build }}
107102
path: wheelhouse/*.whl

0 commit comments

Comments
 (0)