diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2fd7157 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +# Workflow to build and test wheels +name: Wheel builder + +on: + push: + branches: + - main + # Release branches + - "release-*" + pull_request: + branches: + - main + - "release-*" + # Manual run + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + + # Build the wheels for Linux, Windows and macOS for Python 3.8 and newer + build_wheels: + name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }} + runs-on: 'ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + + - name: Build a binary wheel and a source tarball + run: >- + python3 -m + build + --wheel + --outdir dist/ + + - name: Store artifacts + uses: actions/upload-artifact@v3 + with: + path: dist/*.whl + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: dist/*.whl \ No newline at end of file