|
| 1 | +name: Build wheels |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - "[0-9]+.[0-9]+.[0-9]+" |
| 6 | + - "[0-9]+.[0-9]+.[0-9]+-**" |
| 7 | + |
| 8 | +jobs: |
| 9 | + sdist: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + |
| 14 | + - uses: actions/setup-python@v5 |
| 15 | + with: |
| 16 | + python-version: "3.12" |
| 17 | + |
| 18 | + - name: Install build tools |
| 19 | + run: | |
| 20 | + python -m pip install -U pip |
| 21 | + pip install setuptools |
| 22 | +
|
| 23 | + - name: Build sdist |
| 24 | + run: | |
| 25 | + python setup.py sdist |
| 26 | +
|
| 27 | + - uses: actions/upload-artifact@v4 |
| 28 | + with: |
| 29 | + name: sdist |
| 30 | + path: dist/sqlcipher3*.tar.gz |
| 31 | + |
| 32 | + wheels: |
| 33 | + runs-on: ${{ matrix.os }} |
| 34 | + strategy: |
| 35 | + matrix: |
| 36 | + include: |
| 37 | + - os: ubuntu-latest |
| 38 | + cibw_archs: x86_64 |
| 39 | + cibw_build: "cp*-manylinux_*" |
| 40 | + cibw_skip: "" |
| 41 | + compile_target: x86_64 |
| 42 | + out: x86_64-manylinux |
| 43 | + - os: ubuntu-latest |
| 44 | + cibw_archs: x86_64 |
| 45 | + cibw_build: "cp*-musllinux_*" |
| 46 | + cibw_skip: "" |
| 47 | + compile_target: x86_64 |
| 48 | + out: x86_64-musllinux |
| 49 | + - os: ubuntu-24.04-arm |
| 50 | + cibw_archs: aarch64 |
| 51 | + cibw_build: "cp*-manylinux_*" |
| 52 | + cibw_skip: "" |
| 53 | + compile_target: armv8 |
| 54 | + out: armv8-manylinux |
| 55 | + - os: ubuntu-24.04-arm |
| 56 | + cibw_archs: aarch64 |
| 57 | + cibw_build: "cp*-musllinux_*" |
| 58 | + cibw_skip: "" |
| 59 | + compile_target: armv8 |
| 60 | + out: armv8-musllinux |
| 61 | + - os: ubuntu-latest |
| 62 | + cibw_archs: i686 |
| 63 | + cibw_build: "cp*-manylinux_*" |
| 64 | + cibw_skip: "" |
| 65 | + compile_target: x86 |
| 66 | + out: x86-manylinux |
| 67 | + - os: windows-latest |
| 68 | + cibw_archs: AMD64 |
| 69 | + cibw_build: "cp*" |
| 70 | + cibw_skip: "" |
| 71 | + compile_target: x86_64 |
| 72 | + out: x86_64-windows |
| 73 | + - os: windows-latest |
| 74 | + cibw_archs: x86 |
| 75 | + cibw_build: "cp*" |
| 76 | + cibw_skip: "" |
| 77 | + compile_target: x86 |
| 78 | + out: x86-windows |
| 79 | + - os: windows-latest |
| 80 | + cibw_archs: ARM64 |
| 81 | + cibw_build: "cp*" |
| 82 | + cibw_skip: "" |
| 83 | + compile_target: armv8 |
| 84 | + out: armv8-windows |
| 85 | + - os: macos-15-intel |
| 86 | + cibw_archs: x86_64 |
| 87 | + cibw_build: "cp*" |
| 88 | + cibw_skip: "" |
| 89 | + compile_target: x86_64 |
| 90 | + out: x86_64-macos |
| 91 | + - os: macos-latest |
| 92 | + cibw_archs: arm64 |
| 93 | + cibw_build: "cp*" |
| 94 | + cibw_skip: "" |
| 95 | + compile_target: armv8 |
| 96 | + out: armv8-macos |
| 97 | + - os: macos-latest |
| 98 | + cibw_archs: universal2 |
| 99 | + cibw_build: "cp*" |
| 100 | + cibw_skip: "" |
| 101 | + compile_target: universal2 |
| 102 | + out: universal2-macos |
| 103 | + |
| 104 | + steps: |
| 105 | + - uses: actions/checkout@v4 |
| 106 | + |
| 107 | + - uses: actions/setup-python@v5 |
| 108 | + with: |
| 109 | + python-version: "3.12" |
| 110 | + |
| 111 | + - name: Set up QEMU |
| 112 | + if: runner.os == 'Linux' |
| 113 | + uses: docker/setup-qemu-action@v3 |
| 114 | + with: |
| 115 | + platforms: all |
| 116 | + # This should be temporary |
| 117 | + # xref https://github.com/docker/setup-qemu-action/issues/188 |
| 118 | + # xref https://github.com/tonistiigi/binfmt/issues/215 |
| 119 | + image: tonistiigi/binfmt:qemu-v8.1.5 |
| 120 | + |
| 121 | + - name: Build wheels for ${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }} |
| 122 | + uses: pypa/cibuildwheel@v3.3.0 |
| 123 | + env: |
| 124 | + CIBW_BUILD_FRONTEND: build |
| 125 | + CIBW_BUILD: ${{ matrix.cibw_build }} |
| 126 | + CIBW_SKIP: ${{ matrix.cibw_skip }} |
| 127 | + CIBW_ARCHS: ${{ matrix.cibw_archs }} |
| 128 | + CIBW_ENVIRONMENT: SQLCIPHER3_COMPILE_TARGET=${{ matrix.compile_target }} |
| 129 | + CIBW_BEFORE_ALL_LINUX: command -v yum >/dev/null && yum -y install perl-core || command -v apk >/dev/null && apk add perl || true |
| 130 | + CIBW_TEST_COMMAND: > |
| 131 | + mv {project}/sqlcipher3 {project}/sqlcipher3_ && |
| 132 | + python {project}/tests/ && |
| 133 | + mv {project}/sqlcipher3_ {project}/sqlcipher3 |
| 134 | +
|
| 135 | + - uses: actions/upload-artifact@v4 |
| 136 | + with: |
| 137 | + name: wheels-${{ matrix.out }} |
| 138 | + path: wheelhouse/*.whl |
| 139 | + |
| 140 | + publish: |
| 141 | + needs: [sdist, wheels] |
| 142 | + runs-on: ubuntu-latest |
| 143 | + steps: |
| 144 | + - uses: actions/download-artifact@v4 |
| 145 | + with: |
| 146 | + pattern: wheels-* |
| 147 | + path: dist |
| 148 | + merge-multiple: true |
| 149 | + |
| 150 | + - uses: actions/download-artifact@v4 |
| 151 | + with: |
| 152 | + name: sdist |
| 153 | + path: dist |
| 154 | + merge-multiple: true |
| 155 | + |
| 156 | + - uses: pypa/gh-action-pypi-publish@release/v1 |
| 157 | + with: |
| 158 | + user: __token__ |
| 159 | + password: ${{ secrets.PYPI_API_TOKEN }} |
0 commit comments