diff --git a/.github/workflows/docker/buildwheel.sh b/.github/workflows/docker/buildwheel.sh deleted file mode 100644 index 960e621..0000000 --- a/.github/workflows/docker/buildwheel.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -DOCKER_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source "$DOCKER_DIR/shared.env" - -set -e -x - -ARCH=`uname -p` -echo "arch=$ARCH" - - -for V in "${PYTHON_VERSIONS[@]}"; do - PYBIN=/opt/python/$V/bin - rm -rf build/ # Avoid lib build by narrow Python is used by wide python - $PYBIN/python -m pip install build twine - $PYBIN/python -m build --wheel -done - -# Validate all wheels with twine -for wheel in dist/*.whl; do - /opt/python/cp310-cp310/bin/python -m twine check "$wheel" -done - -rm dist/*.tar.gz \ No newline at end of file diff --git a/.github/workflows/docker/shared.env b/.github/workflows/docker/shared.env deleted file mode 100644 index d11b41f..0000000 --- a/.github/workflows/docker/shared.env +++ /dev/null @@ -1,5 +0,0 @@ -PYTHON_VERSIONS=( - cp313-cp313 - cp312-cp312 - cp311-cp311 -) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b3760bd..b8201fe 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,140 +1,52 @@ -name: Build and test wheels +name: Publish Python release on: push: - branches: - - main - - test - tags: - - '*' + branches: [test-publish] release: types: [published] jobs: - manylinux: + build: runs-on: ubuntu-24.04 steps: - - name: Checkout - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v4.2.2 with: - submodules: true + fetch-depth: 0 - - name: Set up Python 3.11 - uses: actions/setup-python@v5.4.0 + - name: Install uv + uses: astral-sh/setup-uv@v6 with: - python-version: "3.11" + python-version: "3.12" + version: "0.8.15" - - name: Build sdist - shell: bash - run: | - python -m pip install build twine - python -m build --sdist - python -m twine check dist/*.tar.gz + - name: Build + run: uv build - - name: Upload sdist - uses: actions/upload-artifact@v4.6.1 + - uses: actions/upload-artifact@v4 with: - name: sdist - path: dist - - - name: Build wheels in docker - shell: bash - run: | - docker run --rm -v `pwd`:/project -w /project quay.io/pypa/manylinux2014_x86_64 bash .github/workflows/docker/buildwheel.sh - - - name: Upload Wheels - uses: actions/upload-artifact@v4.6.1 - with: - name: wheels - path: dist - - OSX-test: - needs: ['manylinux'] - runs-on: macos-latest - strategy: - matrix: - python: [3.11, 3.12, 3.13] - steps: - - name: Download wheels - uses: actions/download-artifact@v4.2.0 - with: - name: wheels - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5.4.0 - with: - python-version: ${{ matrix.python }} - - name: Install wheel and test - run: | - python -VV - # Install the local wheel - pip install tszip --only-binary tszip -f . - python -c "import tszip" + name: dist + path: dist/ - windows-test: - needs: ['manylinux'] - runs-on: windows-latest - strategy: - matrix: - python: [3.11, 3.12, 3.13] - wordsize: [64] - steps: - - name: Download wheels - uses: actions/download-artifact@v4.2.0 - with: - name: wheels - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5.4.0 - with: - python-version: ${{ matrix.python }} - - name: Install wheel and test - run: | - python -VV - pip install wheel - # Install the local wheel - pip install tszip --only-binary tszip -f . - python -c "import tszip" - - manylinux-test: - runs-on: ubuntu-24.04 - needs: ['manylinux'] - strategy: - matrix: - python: [3.11, 3.12, 3.13] - steps: - - name: Download wheels - uses: actions/download-artifact@v4.2.0 - with: - name: wheels - - name: Set up Python - uses: actions/setup-python@v5.4.0 - with: - python-version: ${{ matrix.python }} - - name: Install wheel and test - run: | - python -VV - # Install the local wheel - pip install tszip --only-binary tszip -f . - python -c "import tszip" - - - PyPI_Upload: + publish: runs-on: ubuntu-24.04 environment: release - needs: [ 'windows-test', 'OSX-test', 'manylinux-test' ] + needs: [build] permissions: id-token: write steps: - - name: Download all - uses: actions/download-artifact@v4.2.0 - - name: Move to dist - run: | - mkdir dist - cp */*.{whl,gz} dist/. - - name: Publish distribution to Test PyPI - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + - uses: actions/download-artifact@v7.0.0 + with: + name: dist + path: dist + + - name: Publish to TestPyPI + if: github.event_name == 'push' && github.ref_name == 'test-publish' uses: pypa/gh-action-pypi-publish@v1.13.0 with: - repository_url: https://test.pypi.org/legacy/ - - name: Publish distribution to PRODUCTION PyPI + repository-url: https://test.pypi.org/legacy/ + verbose: true + + - name: Publish to PyPI if: github.event_name == 'release' uses: pypa/gh-action-pypi-publish@v1.13.0