comparison mupdf-source/thirdparty/zxing-cpp/.github/workflows/publish-python.yml @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 name: publish-python
2
3 on:
4 release:
5 types: [published]
6
7 workflow_dispatch:
8 inputs:
9 publish:
10 description: 'Publish package (y/n)'
11 default: 'n'
12 # push:
13 # branches: [master]
14 # tags: ["v*.*.*"]
15 # pull_request:
16 # branches: [master]
17
18 jobs:
19 build-wheels:
20 name: Build wheels on ${{ matrix.os }}
21 runs-on: ${{ matrix.os }}
22 strategy:
23 fail-fast: false
24 matrix:
25 os: [ubuntu-latest, macos-13, windows-latest] # at least macos-13 is required to enable c++20 support
26
27 steps:
28 - uses: actions/checkout@v4
29 with:
30 submodules: true
31
32 - name: Set up Python
33 uses: actions/setup-python@v5
34 with:
35 python-version: '3.12'
36
37 - name: Install cibuildwheel
38 run: python3 -m pip install cibuildwheel==2.22.0
39
40 - name: Build wheels
41 run: python3 -m cibuildwheel --output-dir wheelhouse wrappers/python
42 env:
43 # TODO: setup a "BEFORE" cmake build and link the python module to the prebuild libZXing.a
44 # see https://github.com/YannickJadoul/Parselmouth/blob/523c117aa780184345121f6ff8315670bc7d4d94/.github/workflows/wheels.yml#L120
45 CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-*
46 CIBW_SKIP: "*musllinux*"
47 # the default maylinux2014 image does not contain a c++20 compiler, see https://github.com/pypa/manylinux
48 CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
49 # CIBW_ARCHS_MACOS: "x86_64 arm64"
50 CIBW_ARCHS_MACOS: universal2
51 CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES="arm64;x86_64"
52 # the default macOS target version is 10.9. it might be required to increase that to support c++20 or later features.
53 # MACOSX_DEPLOYMENT_TARGET: "10.15"
54 CIBW_BUILD_VERBOSITY: 1
55
56 - name: Upload wheels
57 uses: actions/upload-artifact@v4
58 with:
59 name: cibw-wheels-${{ matrix.os }}
60 path: ./wheelhouse/*.whl
61
62 build-sdist:
63 name: Build source distribution
64 runs-on: ubuntu-latest
65 steps:
66 - uses: actions/checkout@v4
67 with:
68 submodules: true
69
70 - name: Set up Python
71 uses: actions/setup-python@v5
72 with:
73 python-version: '3.13'
74
75 - name: Install dependencies
76 working-directory: wrappers/python
77 run: python -m pip install --upgrade pip setuptools
78
79 - name: Build sdist
80 working-directory: wrappers/python
81 run: python3 setup.py sdist
82
83 - name: Upload sdist
84 uses: actions/upload-artifact@v4
85 with:
86 name: cibw-sdist
87 path: wrappers/python/dist/*.tar.gz
88
89 upload-pypi:
90 name: Upload to PyPI
91 needs: [build-wheels, build-sdist]
92 runs-on: ubuntu-latest
93 environment:
94 name: pypi
95 url: https://pypi.org/p/zxing-cpp
96 permissions:
97 id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
98 # only run if the commit is tagged...
99 # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
100 if: github.event_name == 'release' || github.event.inputs.publish == 'y'
101 steps:
102 - uses: actions/download-artifact@v4
103 with:
104 pattern: cibw-*
105 path: dist
106 merge-multiple: true
107
108 - name: List wheels
109 run: ls dist
110
111 - uses: pypa/gh-action-pypi-publish@release/v1
112 # with:
113 # repository-url: https://test.pypi.org/legacy/