Skip to content

Update macOS target to macOS 11 and update minimum python to 3.8 #1442

Update macOS target to macOS 11 and update minimum python to 3.8

Update macOS target to macOS 11 and update minimum python to 3.8 #1442

name: Build ARM64 wheels on ubuntu-latest
on:
push:
branches:
- main
- dev
tags:
- '**'
pull_request:
branches:
- '**'
jobs:
build_wheels:
name: ARM64 Python Wheels on ARM64 Ubuntu
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [[ARM64, Linux]]
steps:
- uses: Chia-Network/actions/clean-workspace@main
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Build Python wheels
run: |
docker run --rm \
-v ${{ github.workspace }}:/ws --workdir=/ws \
quay.io/pypa/manylinux2014_aarch64 \
bash -exc '\
echo $PATH && \
curl -L https://sh.rustup.rs > rustup-init.sh && \
sh rustup-init.sh -y && \
yum -y install openssl-devel && \
source $HOME/.cargo/env && \
rustup target add aarch64-unknown-linux-musl && \
rm -rf venv && \
export PATH=/opt/python/cp310-cp310/bin/:$PATH && \
export PATH=/opt/python/cp39-cp39/bin/:$PATH && \
export PATH=/opt/python/cp38-cp38/bin/:$PATH && \
export PATH=/opt/python/cp37-cp37m/bin/:$PATH && \
/opt/python/cp38-cp38/bin/python -m venv venv && \
if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi && \
. ./activate && \
pip install maturin && \
CC=gcc maturin build -m wheel/Cargo.toml --release --strip --manylinux 2014 --features=openssl \
'
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels/
- name: Install Twine
run: |
if [ ! -f "venv" ]; then sudo rm -rf venv; fi
sudo apt-get install python3-venv python3-pip -y
python3 -m venv venv
if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi
. ./activate
pip install setuptools_rust
pip install twine
- name: Test for secrets access
id: check_secrets
shell: bash
run: |
unset HAS_SECRET
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
echo "HAS_SECRET=${HAS_SECRET}" >>$GITHUB_OUTPUT
env:
SECRET: "${{ secrets.test_pypi_password }}"
- name: publish (PyPi)
if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
. ./activate
twine upload --non-interactive --skip-existing --verbose 'target/wheels/*'
- name: Clean up AMR64
if: startsWith(matrix.os, 'ARM64')
run: |
rm -rf venv
rm -rf dist