diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..93bc45a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,81 @@ +name: Build and Deploy Package (New) + +on: + push: + branches: [ master ] + release: + types: [ created ] + pull_request: + branches: [ master ] + +jobs: + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: "recursive" + fetch-depth: 0 + + - name: Build sdist + run: | + pip install -r requirements.txt + python setup.py sdist + + - uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + + build_wheels: + name: Build wheels on ${{ matrix.os }} CIBW_BUILD=${{ matrix.cibw_build }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + cibw_build: [cp38-*, cp39-*, cp310-*, cp311-*] + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + with: + submodules: "recursive" + fetch-depth: 0 + + - name: Setup QEMU # Needed to build aarch64 wheels + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v2 + with: + platforms: all + + - name: Build wheels + uses: pypa/cibuildwheel@v2.12.3 + env: + CIBW_ARCHS_LINUX: "x86_64 i686 aarch64" + CIBW_ARCHS_MACOS: "x86_64 arm64" + CIBW_ARCHS_WINDOWS: "AMD64 x86" + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_SKIP: "pp* *-musllinux_aarch64" # Don't build musllinux wheels for aarch64 + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: "pytest {project}/test" + CIBW_TEST_SKIP: "*-macosx_arm64" # Testing on Apple Silicon currently not supported. + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + + upload_pypi: + needs: [build_sdist, build_wheels] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') + steps: + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.8.8 + with: + user: __token__ + password: ${{ secrets.pypi_api_token }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ed38bec..ac62ad1 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,21 +15,22 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] + python-version: [3.8, 3.9, "3.10", "3.11"] steps: - uses: actions/checkout@v3 with: submodules: 'recursive' + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install pytest - pip install -r requirements.txt pip install -e . - name: Test with pytest run: |