diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9cc50f2..cf04d2f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -23,6 +23,8 @@ jobs: build-sdist: name: Build source distribution runs-on: ubuntu-latest + timeout-minutes: 20 + if: github.repository_owner == 'aarnphm' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # Don't run on fork repository steps: - name: Checkout uses: actions/checkout@v3 @@ -36,16 +38,19 @@ jobs: pip install build python -m build --sdist - - uses: actions/upload-artifact@v3 - with: - path: dist/*.tar.gz + - name: Upload to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + pip install twine + twine upload dist/* --repository pypi --verbose - publish: - name: Build and publish wheels to PyPI for python${{ matrix.python }} (${{ matrix.os }}) - needs: [build-sdist] + build-wheel: + name: Build wheels for python${{ matrix.python }} (${{ matrix.os }}) runs-on: ${{ matrix.os }} timeout-minutes: 20 - if: github.repository_owner == 'aarnphm' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # Don't run on fork repository + if: github.repository_owner == 'aarnphm' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # Don't run on fork repository strategy: fail-fast: false matrix: @@ -73,15 +78,11 @@ jobs: run: | VERSION=${{ github.ref_name }} echo "version=${VERSION:1}" >>$GITHUB_OUTPUT - - uses: actions/download-artifact@v3 - with: - name: artifact - path: dist - name: Publish built wheels env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | - pip install twine - twine upload dist/* --repository pypi --verbose + + ./tools/bazel run //requirements:pypi.update ./tools/bazel run -c dbg --define=ci=true --stamp --embed_label=${{ steps.get-info.outputs.version }} -- //:whispercpp_wheel.publish --repository pypi --verbose diff --git a/pyproject.toml b/pyproject.toml index 9a5918e..c84716d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ description = "whispercpp: Pybind11 bindings for whisper.cpp" readme = { file = "README.md", content-type = "text/markdown" } license = { text = "Apache-2.0" } requires-python = ">=3.8" -version = "0.0.3" +version = "0.0.4" classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers",