diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index 7ce00a6..9e6a4ad 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -1,6 +1,15 @@ -name: Build wheels - -on: [push] +name: Test, build, release + +on: + pull_request: + branches: + - master + push: + branches: + - master + - 'releases/**' + release: + types: [created] jobs: format_test: @@ -55,6 +64,7 @@ jobs: build_wheels: name: Build wheels on ${{ matrix.os }} needs: [function_test] + if: github.event_name == 'release' && github.event.action == 'published' runs-on: ${{ matrix.os }} strategy: matrix: @@ -71,9 +81,6 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse - # to supply options, put them in 'env', like: - # env: - # CIBW_SOME_OPTION: value - uses: actions/upload-artifact@v4 with: @@ -102,9 +109,7 @@ jobs: environment: deploy permissions: id-token: write - #if: github.event_name == 'release' && github.event.action == 'published' - # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + if: github.event_name == 'release' && github.event.action == 'published' steps: - name: Get artifacts uses: actions/download-artifact@v4 @@ -115,6 +120,4 @@ jobs: merge-multiple: true - name: Upload - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ \ No newline at end of file + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file