Skip to content

Downgrade upload artifact from 3 to 4. #281

Downgrade upload artifact from 3 to 4.

Downgrade upload artifact from 3 to 4. #281

Workflow file for this run

on:
pull_request:
release:
types:
- published
name: Build
jobs:
# Mostly taken from https://github.com/etesync/etebase-py/blob/ee7bf21e9f57f0ce37f08d1f5cefd8ef0d3bb2f7/.github/workflows/manual.yml
# and https://github.com/Daggy1234/polaroid/blob/ace9a6eee74ee9c30edd0d350d65e2f3b4d8430c/.github/workflows/publish.yml
# See pyproject.toml for configuration.
python-build-wheels:
name: Python wheels (${{ matrix.os }}, ${{ matrix.vers }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include: # https://cibuildwheel.readthedocs.io/en/stable/options/#archs
# - vers: aarch64
# os: ubuntu-20.04
- vers: x86_64
os: ubuntu-20.04
- vers: arm64
os: macos-latest
- vers: x86_64
os: macos-latest
- vers: universal2
os: macos-latest
- vers: AMD64
os: windows-2019
# win32: Build fails with error: your Rust target architecture (64-bit) does not match your python interpreter (32-bit)
# - vers: x86
# os: windows-2019
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
# QEMU emulates an arm64 system on X86. This is needed to build the aarch64 wheels
# on GH actions. It's slow. See
# https://github.com/docker/setup-qemu-action/issues/22 and
# https://github.com/pypa/cibuildwheel/issues/598
- name: Set up QEMU
if: runner.os == 'Linux' && matrix.vers == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Install darwin target for apple silicon
if: matrix.vers == 'universal2' || (matrix.vers == 'arm64' && matrix.os == 'macos-latest')
run: rustup target add aarch64-apple-darwin
- name: Setup env when not using docker
if: runner.os != 'Linux'
run: |
python -m pip install --upgrade wheel setuptools setuptools-rust
- name: Install cibuildwheel
run: |
pip install cibuildwheel
- name: Build wheels
run: |
python -m cibuildwheel changeforest-py --archs ${{ matrix.vers }} --output-dir wheelhouse
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
python-build-sdist:
name: Python sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
- name: Install build dependencies
run: python -m pip install numpy maturin
- name: Build sdist
run: maturin sdist -m changeforest-py/Cargo.toml
- uses: actions/upload-artifact@v3
with:
name: wheels
path: changeforest-py/target/wheels/*.tar.gz
upload-testpypi:
needs: [python-build-wheels, python-build-sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TESTPYPI_GH_TOKEN }}
repository_url: https://test.pypi.org/legacy/
upload-pypi:
needs: [python-build-wheels, python-build-sdist, upload-testpypi]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_GH_TOKEN }}
release-crates-io:
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v4
- run: cargo login ${CRATES_IO_TOKEN}
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- run: cargo publish