diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 05b11db..8433e17 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -5,19 +5,25 @@ on: branches: - master workflow_dispatch: + release: + types: + - published jobs: build_sdist: name: Build source distribution runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-sdist path: dist/*.tar.gz build_wheels: @@ -28,11 +34,36 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-${{ matrix.os }} path: ./wheelhouse/*.whl + + upload_pypi: + needs: + - build_wheels + - build_sdist + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + # Comment this line for testing + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + - uses: pypa/gh-action-pypi-publish@release/v1 + # Uncomment these lines for testing + # with: + # repository-url: https://test.pypi.org/legacy/ diff --git a/.gitignore b/.gitignore index 503c079..17d1c61 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ CMakeFiles CTestTestfile.cmake DartConfiguration.tcl cmake_install.cmake +py/soundswallower/_version.py diff --git a/pyproject.toml b/pyproject.toml index c2cf532..e2ca1da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "scikit_build_core.build" [project] name = "soundswallower" -version = "0.6.1" +dynamic = ["version"] description = "An even smaller speech recognizer" readme = "README.md" authors = [ @@ -41,7 +41,6 @@ soundswallower = "soundswallower.cli:main" [tool.cibuildwheel] # Build a reduced selection of binaries as there are tons of them build = [ - "pp310*", "cp38-*", "cp310-*", "cp311-*", @@ -53,6 +52,7 @@ skip = [ "cp*-macosx_x86_64", "cp*-macosx_arm64", "*_i686", + "*musl*", "*-win32", ] @@ -67,6 +67,11 @@ extend-ignore = "E203" max-line-length = "88" [tool.scikit-build] +metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" +sdist.include = ["py/soundswallwer/_version.py"] cmake.verbose = true logging.level = "INFO" wheel.packages = ["py/soundswallower"] + +[tool.setuptools_scm] +write_to = "py/soundswallower/_version.py"