Version bump. #287
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
# This workflow only runs for tags. It takes a lot of time to complete because | |
# it has to bundle Z3 statically into the final binary. | |
# Specifically, we: | |
# - Build the library using static Z3 on linux/windows/macOS and upload the result to GitHub storage. | |
# - Create a release package from the uploaded wheel files and push it to PyPI. | |
# - Do the same thing for conda, but also for different versions of Python. | |
name: build | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
# A fixed version used for testing, so that the builds don't | |
# spontaneously break after a few years. | |
# Make sure to update this from time to time. | |
RUST_VERSION: "1.79.0" | |
# This is the version currently used by `z3-sys`. | |
# If this ever changes, you might also need to increase | |
# the minimum macOS version below. | |
Z3_VERSION: "4.8.12" | |
MACOS_TARGET: "11.0" | |
PYTHON_VERSION: "3.12" | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v4 | |
# On linux, everything is installed in the container, | |
# so we don't really need any dependencies here. | |
- name: Maturin build. | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: x86_64 | |
container: daemontus/manylinux-aeon:latest | |
args: "--release --features static-z3 --compatibility manylinux_2_28 --out=target/dist" | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: target/dist | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v4 | |
- name: Setup Python. | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
architecture: x64 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
# The considered version of z3 needs at least this version of macOS. | |
- run: echo "MACOSX_DEPLOYMENT_TARGET=${{ env.MACOS_TARGET }}" >> $GITHUB_ENV | |
- run: echo "CMAKE_OSX_DEPLOYMENT_TARGET=${{ env.MACOS_TARGET }}" >> $GITHUB_ENV | |
- name: Maturin build. | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: build | |
args: "--release --target universal2-apple-darwin --features static-z3 --out=target/dist" | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: target/dist | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v4 | |
- name: Setup Python. | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
architecture: x64 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
# Surprisingly, windows is the easiest. Just build the thing. | |
- name: Maturin build. | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: x64 | |
args: "--release --features static-z3 --out=target/dist" | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: target/dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [ build-macos, build-windows, build-linux ] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --skip-existing * | |
conda_deployment_with_new_tag: | |
name: Conda deployment (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# For now, windows builds are broken... | |
os: [macos-latest, ubuntu-latest] | |
python: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Conda environment creation and activation | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
environment-file: conda_env.yaml | |
auto-update-conda: false | |
auto-activate-base: false | |
show-channel-urls: true | |
- name: Build and upload the conda packages | |
uses: uibcdf/[email protected] | |
with: | |
python-version: ${{ matrix.python }} | |
meta_yaml_dir: "conda" | |
user: daemontus | |
label: main | |
overwrite: false | |
token: ${{ secrets.ANACONDA_TOKEN }} |