pump version #271
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: build | |
on: | |
push: | |
pull_request: | |
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.76.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.11" | |
jobs: | |
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 | |
macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v4 | |
- name: Setup Z3. | |
id: z3 | |
uses: cda-tum/setup-z3@v1 | |
with: | |
version: ${{ env.Z3_VERSION }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Python. | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
architecture: x64 | |
- name: Setup Rust toolchain. | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ env.RUST_VERSION }} | |
# Explicitly add z3 to include path (probably some bug in either | |
# `setup-z3` or `z3-sys` crate, because this should not be necessary). | |
- run: echo "CPATH=$Z3_ROOT/include" >> $GITHUB_ENV | |
# 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 | |
windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v4 | |
- name: Setup Python. | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
architecture: x64 | |
- name: Setup Rust toolchain. | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-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 | |
if: "startsWith(github.ref, 'refs/tags/')" | |
needs: [ macos, windows, 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 }}) | |
if: "startsWith(github.ref, 'refs/tags/')" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# For now, windows builds are broken... | |
os: [macos-latest, ubuntu-latest] | |
python: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Conda environment creation and activation | |
uses: conda-incubator/setup-miniconda@v2 | |
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 }} |