Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Changes to sexp.rs's handling of termlist and clone optimisations #1346

Changes to sexp.rs's handling of termlist and clone optimisations

Changes to sexp.rs's handling of termlist and clone optimisations #1346

name: Build ARM64 wheels on ubuntu-latest
on:
push:
branches:
- main
- dev
tags:
- '**'
pull_request:
branches:
- '**'
permissions:
id-token: write
contents: read
jobs:
build_wheels:
name: Build ARM64 Python Wheels
runs-on: [ARM64, Linux]
container:
image: ghcr.io/chia-network/build-images/centos-pypa-rust-aarch64:latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up
run: |
echo "${PATH}"
yum -y install openssl-devel
source /root/.cargo/env
rustup default stable
rustup target add aarch64-unknown-linux-musl
rm -rf venv
export PATH="${PATH}:/opt/python/cp39-cp39/bin/:/opt/python/cp38-cp38/bin/:/opt/python/cp37-cp37m/bin/"
- name: Build Python wheels
run: |
/opt/python/cp38-cp38/bin/python -m venv venv
if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi
. ./activate
pip install maturin==1.1.0
CC=gcc maturin build --release --strip --manylinux 2014
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels/
- name: Clean up AMR64
run: |
rm -rf venv
rm -rf dist
publish_wheels:
name: Publish ARM64 Python Wheels
runs-on: ubuntu-latest
needs: build_wheels
steps:
- name: Fetch wheels from previous job
uses: actions/download-artifact@v3
with:
name: wheels
path: target/wheels/
- name: Install Twine
run: |
if [ ! -f "venv" ]; then rm -rf venv; fi
sudo apt install python3 python3-pip -y
python3 -m venv venv
if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi
. ./activate
pip3 install setuptools_rust
pip3 install twine
- name: Test for secrets access
id: check_secrets
shell: bash
run: |
unset HAS_SECRET
unset HAS_AWS_SECRET
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
echo "HAS_SECRET=${HAS_SECRET}" >>$GITHUB_OUTPUT
if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi
echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT
env:
SECRET: "${{ secrets.test_pypi_password }}"
AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}"
- 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: publish (Test PyPi)
if: steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: |
. ./activate
twine upload --non-interactive --skip-existing --verbose 'target/wheels/*'
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ secrets.CHIA_AWS_ACCOUNT_ID }}:role/installer-upload
aws-region: us-west-2
- name: Publish Dev
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/dev'
run: |
FILES=$(find ${{ github.workspace }}/target/wheels -type f -name '*.whl')
while IFS= read -r file; do
filename=$(basename $file)
aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename"
done <<< "$FILES"