diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0d87ce7..9adbe65 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,6 +1,6 @@ name: Build and upload to PyPI -# Build on every branch push, tag push, and pull request change: +# Build on every pull request change: on: [push, pull_request] jobs: @@ -35,9 +35,12 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 - - uses: actions/upload-artifact@v4 + - name: Upload wheels artifacts + # Upload wheels only on tag push + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v4 with: - name: artifact-${{ matrix.os }} + name: bigml_sensenet-${{ github.ref_name }}-${{ matrix.build }}-${{ matrix.os }}_${{ matrix.arch }} path: ./wheelhouse/*.whl build_sdist: @@ -49,9 +52,12 @@ jobs: - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v4 + - name: Upload sdist artifacts + # Upload sdist only on tag push + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v4 with: - name: artifact-${{ matrix.os }} + name: bigml_sensenet-${{ github.ref_name }} path: dist/*.tar.gz upload_pypi: @@ -62,8 +68,12 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - path: dist - pattern: artifact-* + path: all + + - name: Merge files + run: | + mkdir dist + mv all/*/* dist/. - uses: pypa/gh-action-pypi-publish@v1.4.2 with: