diff --git a/.circleci/config.yml b/.circleci/config.yml index d30ea7f..bad9e32 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,69 +1,82 @@ -# This config was automatically generated from your source code -# Stacks detected: cicd:github-actions:.github/workflows,deps:python:.,deps:rust:.,file:setup.py:.,package_manager:poetry:. version: 2.1 + orbs: python: circleci/python@2 + +workflows: + version: 2 + build-and-publish: + jobs: + - build_x86_64: + filters: + branches: + only: main + tags: + only: /v.*/ + - build_aarch64: + filters: + branches: + only: main + tags: + only: /v.*/ + - publish: + filters: + branches: + only: main + tags: + only: /v.*/ + jobs: - test-python: - # Install dependencies and run tests - docker: - - image: cimg/python:3.9-node + build_x86_64: + machine: + image: ubuntu-2204:2022.04 + arch: amd64 steps: - checkout - - python/install-packages: - pkg-manager: pip-dist + - python/install: + python-version: "3.9" - run: - name: Run tests - command: pytest --junitxml=junit.xml || ((($? == 5)) && echo 'Did not find any tests to run.') - - store_test_results: - path: junit.xml - build-package: - # build python package - docker: - - image: cimg/python:3.9-node - steps: - - checkout + name: Install cibuildwheel + command: python -m pip install cibuildwheel - run: - name: Create the ~/artifacts directory if it doesn't exist - command: mkdir -p ~/artifacts - - python/dist + name: Build wheels + command: cibuildwheel --output-dir wheel_output + environment: + CIBW_ARCHS: "x86_64" + CIBW_MANYLINUX_X86_64_IMAGE: "unaidedelf/cibw_rust:x86_64" - store_artifacts: - path: dist - destination: ~/artifacts - test-rust: - docker: - - image: cimg/rust:1.70 + path: wheel_output + + build_aarch64: + machine: + image: ubuntu-2204:2022.04 + arch: arm64 steps: - checkout - - restore_cache: - key: cargo-{{ checksum "Cargo.lock" }} + - python/install: + python-version: "3.9" - run: - command: cargo test - - save_cache: - key: cargo-{{ checksum "Cargo.lock" }} - paths: - - ~/.cargo - deploy: - # This is an example deploy job, not actually used by the workflow + name: Install cibuildwheel + command: python -m pip install cibuildwheel + - run: + name: Build wheels + command: cibuildwheel --output-dir wheel_output + environment: + CIBW_ARCHS: "aarch64" + CIBW_MANYLINUX_AARCH64_IMAGE: "unaidedelf/cibw_rust:aarch64" + - store_artifacts: + path: wheel_output + + publish: docker: - - image: cimg/base:stable + - image: cimg/python:3.9 steps: - # Replace this with steps to deploy to users - - run: - name: deploy - command: '#e.g. ./deploy.sh' + - checkout - run: - name: found github actions config - command: ':' -workflows: - build-and-test: - jobs: - - test-python - - build-package: - requires: - - test-python - - test-rust - - test-rust - # - deploy: - # requires: - # - build-package + name: Publish to PyPI + command: | + pip install twine + twine upload wheel_output/*.whl -u __token__ -p $PYPI_API_TOKEN + environment: + PYPI_API_TOKEN: ${PYPI_API_TOKEN} + diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 44303b8..a3a68f8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,8 +24,9 @@ jobs: - name: Build wheels run: cibuildwheel --output-dir wheel_output env: - CIBW_ARCHS: "x86_64" + CIBW_ARCHS: "x86_64 aarch64" CIBW_MANYLINUX_X86_64_IMAGE: "unaidedelf/cibw_rust:x86_64" + CIBW_MANYLINUX_AARCH64_IMAGE: "unaidedelf/cibw_rust:aarch64" - name: Upload wheels as artifacts (optional) uses: actions/upload-artifact@v3