diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 629b5ea..c0b5082 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,4 +1,6 @@ name: pytest +permissions: + contents: read on: - pull_request @@ -26,3 +28,53 @@ jobs: - name: pytest run: pytest --cov=pyds + + wheels: + runs-on: ${{ matrix.os }} + needs: pytest + + if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')" + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - uses: actions/checkout@v6 + + - name: recovery tag information + run: git fetch --tags --force + + - uses: actions/setup-python@v4 + with: + python-version: '3.13' + + - name: install cibuildwheel + run: pip install cibuildwheel + + - name: build wheels + run: python -m cibuildwheel + env: + CIBW_ENVIRONMENT_WINDOWS: SKBUILD_CMAKE_ARGS=-GNinja + + - uses: actions/upload-artifact@v5 + with: + name: wheels-${{ matrix.os }} + path: wheelhouse/*.whl + + upload: + runs-on: ubuntu-latest + needs: wheels + + environment: pypi + + steps: + - uses: actions/download-artifact@v3 + with: + pattern: wheels-* + path: dist + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist diff --git a/pyproject.toml b/pyproject.toml index a520081..e02ee65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = [ build-backend = "scikit_build_core.build" [project] -name = "pyds" +name = "apyds" dynamic = ["version"] dependencies = [] requires-python = ">=3.10, <3.14" @@ -22,6 +22,7 @@ version_scheme = "no-guess-dev" fallback_version = "0.0.0" [tool.scikit-build] +wheel.packages = ["pyds"] metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" build.verbose = true