diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06b5758..e502cc9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,69 +1,47 @@ -name: Build and Publish +name: Build and Upload Python Package on: - workflow_dispatch: - pull_request: push: branches: - release jobs: - build_sdist: - name: Build SDist - runs-on: ubuntu-latest - steps: - - name: Checkout out repo and submodules - uses: actions/checkout@v3 - with: - submodules: true - - - name: Build SDist - run: pipx run build --sdist - - - name: Check metadata - run: pipx run twine check dist/* - - - name: Upload SDist - uses: actions/upload-artifact@v3 - with: - path: dist/*.tar.gz + build_and_publish: + name: Build and Publish + runs-on: ${{ matrix.os }} - build_wheels: - name: Build Wheels - runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, 3.10, 3.11, 3.12] - os: [macos-latest, windows-latest, ubuntu-latest] - architecture: [x86_64, arm64] + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: [3.8, 3.9, 3.10, 3.11, 3.12] # Add more versions as needed + architecture: [x64, arm64] # Add arm64 for Apple Silicon + steps: - - name: Checkout out repo and submodules - uses: actions/checkout@v3 - with: - submodules: true + - name: Checkout repository + uses: actions/checkout@v2 - - name: Build Wheels - uses: pypa/cibuildwheel@v2.11.1 + - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - build-options: --arch 64 - platform: ${{ matrix.os }} + architecture: ${{ matrix.architecture }} - - name: Upload Wheels - uses: actions/upload-artifact@v3 - with: - path: wheelhouse/*.whl + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install wheel setuptools - upload_pypi: - name: Upload to Test PyPI - needs: [build_wheels, build_sdist] - runs-on: ubuntu-latest - steps: - - name: Download artifacts - uses: actions/download-artifact@v3 + - name: Build wheel and sdist + run: python setup.py sdist bdist_wheel + + - name: Upload artifact + uses: actions/upload-artifact@v2 with: name: artifact - path: dist + path: dist/* - name: Publish to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1