From: Trevor Gross Date: Sat, 7 May 2022 18:42:19 +0000 (-0400) Subject: Added more logic to wheel build [skip wheels] X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7992%2Fhead;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Added more logic to wheel build [skip wheels] --- diff --git a/.github/workflows/cibuildwheels.yaml b/.github/workflows/cibuildwheels.yaml index 07926efcef..9712012d3b 100644 --- a/.github/workflows/cibuildwheels.yaml +++ b/.github/workflows/cibuildwheels.yaml @@ -4,6 +4,8 @@ on: pull_request: branches: - main + release: + types: [created] # paths-ignore: # - "examples/**" # - "doc/**" @@ -11,7 +13,20 @@ on: jobs: build_wheels: name: Build wheels on ${{ matrix.os }} - # TODO: Add logic to run/ignore on [wheels-build] or [wheels-skip] + # Run if this is a release, OR if commit message contains "[build wheels]" + # OR if the event (PR) has the label "setup", but skip if the commit + # message contains "[skip wheels]" + if: >- + github.event_name == 'release' || + ( + (! contains(github.event.head_commit.message, '[skip wheels]')) && ( + contains(github.event.head_commit.message, '[build wheels]') + ( + github.event.action == 'labeled' && + github.event.label.name == 'setup' + ) + ) + ) runs-on: ${{ matrix.os }} strategy: matrix: @@ -45,21 +60,29 @@ jobs: path: dist/*.tar.gz - # upload_pypi: - # needs: [build_wheels, build_sdist] - # runs-on: ubuntu-latest - # # upload to PyPI on every tag starting with 'v' - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - # # alternatively, to publish when a GitHub Release is created, use the following rule: - # # if: github.event_name == 'release' && github.event.action == 'published' - # steps: - # - uses: actions/download-artifact@v2 - # with: - # name: artifact - # path: dist + upload_pypi: + name: Upload wheels to pypi + # if: github.event_name == 'release' + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + # alternatively, to publish when a GitHub Release is created, use the following rule: + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist - # - uses: pypa/gh-action-pypi-publish@v1.4.2 - # with: - # user: __token__ - # password: ${{ secrets.pypi_password }} - # # To test: repository_url: https://test.pypi.org/legacy/ + - uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + user: __token__ + # password: ${{ secrets.pypi_token }} + # # To test: repository_url: https://test.pypi.org/legacy/ + password: ${{ secrets.test_pypi_token }} + repository_url: https://test.pypi.org/legacy/ + print_hash: true + # skip_existing: true + # skip_existing + # skip_existing diff --git a/pyproject.toml b/pyproject.toml index 14d8cb4f91..22d45fdcf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,6 +95,8 @@ warn_unused_ignores = false before-test = "" test-requires = "pytest pytest-xdist" # Need to change root directory, otherisw the plugin won't find setup.cfg +# Todo: move this to a .sh file, and run +# python -c 'from sqlalchemy.util import has_compiled_ext; assert has_compiled_ext()' test-command = "(cd {project}; pytest --trace-config; pytest -n2 -q test --nomemory --notimingintensive)" build = "*"