From 782bfafa7e2be7712c805da86e5cffde13011aae Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sun, 21 May 2023 23:00:32 -0400 Subject: [PATCH] BUILD Source tarball operations for more-automated releases --- .github/workflows/accelerate-manylinux.yml | 98 +++++++++++++++++++++- 1 file changed, 96 insertions(+), 2 deletions(-) diff --git a/.github/workflows/accelerate-manylinux.yml b/.github/workflows/accelerate-manylinux.yml index 6b2b66c8..9b15cd14 100644 --- a/.github/workflows/accelerate-manylinux.yml +++ b/.github/workflows/accelerate-manylinux.yml @@ -2,9 +2,42 @@ name: Build PyOpenGL-accelerate wheels with manylinux on: push: - branches: [develop,master] + branch: + "develop" jobs: + tarballs: + name: Build source tarballs and root wheels + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball for root + run: >- + python3 -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Build a source tarball for accelerate + run: >- + python3 -m + build + --sdist + --wheel + --outdir accelerate/dist + accelerate + wheels: name: Build architecture-specific wheels on ${{ matrix.os }} @@ -27,8 +60,21 @@ jobs: uses: docker/setup-qemu-action@v2 with: platforms: all - - name: Build wheels + + - name: Build wheels (develop) uses: pypa/cibuildwheel@v2.12.3 + if: ${{ github.ref == 'refs/heads/develop' }} + with: + package-dir: './accelerate' + output-dir: './accelerate/dist' + env: + BUILD_EXTENSION: yes + CIBW_SKIP: 'pp*' + CIBW_BUILD: 'cp311-manylinux_x86_64' + + - name: Build wheels (master) + uses: pypa/cibuildwheel@v2.12.3 + if: ${{ github.ref == 'refs/heads/master' }} with: package-dir: './accelerate' output-dir: './accelerate/dist' @@ -39,4 +85,52 @@ jobs: - name: Save wheels uses: actions/upload-artifact@v3 with: + name: ${{ github.ref }} path: accelerate/dist/*.whl + + # pypi-publish-accel: + # name: Upload Accelerate ${{matrix.repo}} + # runs-on: ubuntu-latest + # # TODO: should be choosing the repo URL based on master/develop + # if: ${{ github.ref == 'refs/heads/develop' }} + # strategy: + # matrix: + # repo: + # - https://test.pypi.org/legacy/ + # permissions: + # # IMPORTANT: this permission is mandatory for trusted publishing + # id-token: write + # steps: + # # retrieve your distributions here + # - name: Publish package distributions to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # username: __token__ + # password: ${{ secrets.PYPI_TOKEN }} + # # Note: this is apparently different than the package-dir meaning in the cibuildwheel + # packages-dir: 'accelerate/dist' + # repository_url: ${{matrix.repo}} + + # pypi-publish-core: + # name: Upload OpenGL to ${{matrix.repo}} + # runs-on: ubuntu-latest + # # TODO: should be choosing the repo URL based on master/develop + # if: ${{ github.ref == 'refs/heads/develop' }} + # strategy: + # matrix: + # repo: + # - https://test.pypi.org/legacy/ + # permissions: + # # IMPORTANT: this permission is mandatory for trusted publishing + # id-token: write + # steps: + # # retrieve your distributions here + + # - name: Publish package distributions to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # username: __token__ + # password: ${{ secrets.PYPI_TOKEN }} + # # Note: this is apparently different than the package-dir meaning in the cibuildwheel + # packages-dir: 'dist' + # repository_url: ${{matrix.repo}}