[build] Add Python 3.12 to Conda and setup.cfg #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to PyPI | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
Deploy-Wheels: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest] | |
archs: [auto64] | |
# manylinux1 is not supported anymore because it won't compile C++17 code | |
# manylinux2010 runs into this problem https://github.com/pypa/cibuildwheel/issues/1001 | |
# MacOS and Windows ignore the manylinux-image version because they are not Linux. | |
include: | |
- os: ubuntu-latest | |
manylinux-image: manylinux2014 | |
archs: auto64 | |
- os: ubuntu-latest | |
manylinux-image: manylinux2014 | |
archs: auto32 | |
- os: ubuntu-latest | |
manylinux-image: manylinux_2_28 | |
archs: auto64 | |
# ------ Begin Copy-Paste of wheels.yml ------ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install Dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install --upgrade-strategy eager --upgrade cython twine cibuildwheel build | |
- name: Build Tarball | |
working-directory: python/indexed_bzip2 | |
run: python3 -m build --sdist | |
- name: Build Wheels | |
env: | |
CIBW_ARCHS: ${{ matrix.archs }} | |
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux-image }} | |
run: python -m cibuildwheel --output-dir dist python/indexed_bzip2 | |
- name: Check Wheels | |
run: twine check dist/* | |
# ------ End Copy-Paste of wheels.yml ------ | |
- name: Publish Tarball to PyPI | |
env: | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
working-directory: python/indexed_bzip2 | |
# Only one out of the OS matrix needs to upload the tarball. | |
if: matrix.manylinux-image == 'manylinux2014' && matrix.os == 'ubuntu-latest' | |
run: twine upload --skip-existing -u __token__ dist/* | |
- name: Publish to PyPI | |
env: | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
run: twine upload --skip-existing -u __token__ dist/* | |
Deploy-Conda: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
- name: Fix macOS CommandLineTools Bug | |
if: matrix.os == 'macos-latest' | |
shell: bash | |
run: | | |
# See test.yml workflow for explanation but in short: conda build only works with the older SDK installed. | |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.9.sdk.tar.xz | |
tar -xf MacOSX10.9.sdk.tar.xz | |
cat <<EOF >> conda/conda_build_config.yaml | |
CONDA_BUILD_SYSROOT: | |
- $PWD/MacOSX10.9.sdk | |
EOF | |
- name: Build Conda Packages | |
# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitely declared as shell: | |
# bash -l {0} on steps that need to be properly activated | |
shell: bash -l {0} | |
env: | |
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
run: | | |
# Circumvent bug introduced in https://github.com/conda/conda/pull/11364#issuecomment-1139184379 | |
# https://github.com/conda/conda-build/issues/4509 | |
conda install conda=4.12.0 conda-build anaconda-client conda-verify packaging | |
conda config --set anaconda_upload yes | |
cd conda | |
python3 -m pip install --user build | |
python3 -m build -o . --sdist ../python/indexed_bzip2 | |
mv indexed_bzip2-*.tar* src.tar | |
conda build --token "$ANACONDA_TOKEN" . |