Skip to content

Merge pull request #17 from yabirgb/python314 #73

Merge pull request #17 from yabirgb/python314

Merge pull request #17 from yabirgb/python314 #73

Workflow file for this run

name: Build
on:
pull_request:
branches:
- main
push:
branches:
- main
- test
tags:
- 'v*'
permissions: {}
env:
LIB_VERSION: '2026.7.1'
PYTHON_VERSION: '3.14'
CIBW_VERSION: '4.1.0'
CIBW_BUILD: 'cp314-* cp314t-*'
CIBW_SKIP: '*-musllinux_*'
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_COMMAND: 'python -c "from pysqlcipher3 import dbapi2 as sqlite; conn = sqlite.connect('':memory:''); conn.close()"'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build_macos_openssl:
runs-on: macos-15
strategy:
matrix:
ARCH:
- NAME: x86_64
CFLAGS: "-mmacosx-version-min=10.09 -march=core2"
OPENSSLDIR: "/usr/local/etc/openssl@3"
FLAGS: no-shared no-asm no-idea no-camellia no-seed no-bf no-cast no-rc2 no-rc4 no-rc5 no-md2 no-md4 no-ecdh no-sock no-ssl3 no-dsa no-dh no-ec no-ecdsa no-tls1 no-rfc3779 no-whirlpool no-srp no-mdc2 no-ecdh no-engine no-srtp no-weak-ssl-ciphers
- NAME: arm64
CFLAGS: "-mmacosx-version-min=11.0"
OPENSSLDIR: "/opt/homebrew/etc/openssl@3"
FLAGS: no-shared no-asm no-idea no-camellia no-seed no-bf no-cast no-rc2 no-rc4 no-rc5 no-md2 no-md4 no-ecdh no-sock no-ssl3 no-dsa no-dh no-ec no-ecdsa no-tls1 no-rfc3779 no-whirlpool no-srp no-mdc2 no-ecdh no-engine no-srtp no-weak-ssl-ciphers
name: "Build OpenSSL for macOS (${{ matrix.ARCH.NAME }})"
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: true
persist-credentials: false
- name: Build OpenSSL
run: |
BASEDIR=$(pwd)
cd openssl
perl ./Configure \
--prefix="${BASEDIR}/artifact" \
--openssldir="${OPENSSLDIR}" \
"darwin64-${ARCH_NAME}-cc" \
${CONFIGURE_FLAGS}
make -j$(sysctl -n hw.logicalcpu) build_sw
make install_sw
env:
ARCH_NAME: ${{ matrix.ARCH.NAME }}
CFLAGS: ${{ matrix.ARCH.CFLAGS }}
CONFIGURE_FLAGS: ${{ matrix.ARCH.FLAGS }}
OPENSSLDIR: ${{ matrix.ARCH.OPENSSLDIR }}
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: "openssl-macos-${{ matrix.ARCH.NAME }}"
path: artifact/
build_wheels_macos:
name: 'Build wheels for macOS'
runs-on: macos-15
strategy:
fail-fast: false
matrix:
arch: [arm64, x86_64]
needs: [build_macos_openssl]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: true
persist-credentials: false
- name: Set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: openssl-macos-${{ matrix.arch }}
path: openssl-macos-${{ matrix.arch }}
- name: prepare build directory
run: ./scripts/prepare.sh
- name: Install cibuildwheel
run: python -m pip install cibuildwheel=="${CIBW_VERSION}"
- name: Build wheels
working-directory: build
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
CIBW_BEFORE_ALL_MACOS: ./build.sh
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pypi-wheels-macos-${{ matrix.arch }}
path: build/wheelhouse/*.whl
build_wheels_linux:
name: 'Build wheels for Linux'
runs-on: ${{ matrix.arch.runner }}
strategy:
fail-fast: false
matrix:
arch:
- name: aarch64
runner: ubuntu-24.04-arm
- name: native
runner: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: true
persist-credentials: false
- name: Set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: prepare build directory
run: ./scripts/prepare.sh
env:
CIBW_ARCHS_LINUX: ${{ matrix.arch.name }}
- name: Install cibuildwheel
run: python -m pip install cibuildwheel=="${CIBW_VERSION}"
- name: Build wheels
working-directory: build
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_ALL_LINUX: ./build.sh
CIBW_ARCHS_LINUX: ${{ matrix.arch.name }}
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pypi-wheels-linux-${{ matrix.arch.name }}
path: build/wheelhouse/*.whl
build_wheels_windows:
name: 'Build wheels for Windows'
runs-on: 'windows-latest'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: true
persist-credentials: false
- name: Set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: prepare build directory
run: ./scripts/prepare.ps1
- name: Install cibuildwheel
run: python -m pip install cibuildwheel=="${env:CIBW_VERSION}"
- name: Build wheels
working-directory: build
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_ALL_WINDOWS: Powershell.exe -F ./build.ps1
CIBW_ARCHS_WINDOWS: "native"
- name: clean openssl conf
shell: pwsh
run: echo "OPENSSL_CONF=''" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pypi-wheels-windows
path: build\wheelhouse\*.whl
build_sdist:
name: 'Build sdist'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: true
persist-credentials: false
- name: Set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: prepare build directory
run: ./scripts/prepare.sh
- name: Build sdist
working-directory: build
run: python3 -m pip install --upgrade build && python -m build -s
- name: Store artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pypi-sdist
path: build/dist/*.tar.gz
upload_pypi_test:
name: Upload to PyPI (test)
needs: [build_wheels_macos, build_wheels_linux, build_wheels_windows, build_sdist]
runs-on: ubuntu-24.04
if: github.event_name == 'push' && !(startsWith(github.ref, 'refs/tags/v'))
environment: test-pypi
permissions:
id-token: write # needed for PyPI Trusted Publishing
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
merge-multiple: true
pattern: pypi-*
path: dist
- uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
upload_pypi:
name: Upload to PyPI (prod)
needs: [build_wheels_macos, build_wheels_linux, build_wheels_windows, build_sdist]
runs-on: ubuntu-24.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
environment: pypi
permissions:
id-token: write # needed for PyPI Trusted Publishing
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
merge-multiple: true
pattern: pypi-*
path: dist
- uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3