release: 0.5.6 #40
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and publish wheels | |
| on: | |
| push: | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| platform: linux | |
| arch: x86_64 | |
| - os: macos-14 | |
| platform: macos | |
| arch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| RAYFORCE_GITHUB: "https://github.com/RayforceDB/rayforce.git" | |
| MACOSX_DEPLOYMENT_TARGET: "11.0" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Install cibuildwheel | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install cibuildwheel | |
| - name: Cache cibuildwheel | |
| uses: actions/cache@v4 | |
| with: | |
| path: .cibw | |
| key: cibw-${{ runner.os }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ hashFiles('pyproject.toml', 'setup.cfg', 'setup.py', 'requirements*.txt') }} | |
| restore-keys: | | |
| cibw-${{ runner.os }}-${{ matrix.platform }}-${{ matrix.arch }}- | |
| - name: Build wheels | |
| env: | |
| CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-*" | |
| CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*" | |
| CIBW_ARCHS: "auto64" | |
| CIBW_BEFORE_BUILD: "bash {project}/scripts/prepare_build.sh" | |
| CIBW_TEST_SKIP: "*" | |
| CIBW_ENVIRONMENT: "RAYFORCE_GITHUB=https://github.com/RayforceDB/rayforce.git" | |
| CIBW_MACOS_ENVIRONMENT: "MACOSX_DEPLOYMENT_TARGET=11.0" | |
| CIBW_CACHE_PATH: ".cibw" | |
| CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux_2_28_x86_64:latest" | |
| CIBW_BEFORE_ALL_LINUX: "yum install -y git gcc clang gcc-c++ make" | |
| run: | | |
| if [ "${{ matrix.platform }}" = "linux" ]; then | |
| cibuildwheel --platform linux --archs x86_64 --output-dir wheelhouse | |
| else | |
| cibuildwheel --platform macos --archs arm64 --output-dir wheelhouse | |
| fi | |
| - name: Upload wheel artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: wheelhouse/*.whl | |
| retention-days: 1 | |
| test_wheels: | |
| name: Test wheels on ${{ matrix.os }} Python ${{ matrix.python-version }} | |
| needs: build_wheels | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| python-version: '3.11' | |
| platform: linux | |
| arch: x86_64 | |
| - os: ubuntu-22.04 | |
| python-version: '3.12' | |
| platform: linux | |
| arch: x86_64 | |
| - os: ubuntu-22.04 | |
| python-version: '3.13' | |
| platform: linux | |
| arch: x86_64 | |
| - os: ubuntu-22.04 | |
| python-version: '3.14' | |
| platform: linux | |
| arch: x86_64 | |
| - os: macos-14 | |
| python-version: '3.11' | |
| platform: macos | |
| arch: arm64 | |
| - os: macos-14 | |
| python-version: '3.12' | |
| platform: macos | |
| arch: arm64 | |
| - os: macos-14 | |
| python-version: '3.13' | |
| platform: macos | |
| arch: arm64 | |
| - os: macos-14 | |
| python-version: '3.14' | |
| platform: macos | |
| arch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - name: Verify AVX2 support (required for rayforce) | |
| if: runner.os == 'Linux' | |
| run: | | |
| echo "Checking CPU features..." | |
| if grep -q avx2 /proc/cpuinfo; then | |
| echo "AVX2 supported" | |
| else | |
| echo "::error::This runner does not support AVX2 instructions required by rayforce" | |
| exit 1 | |
| fi | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Download wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: wheels | |
| - name: Install test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest pytest-asyncio pandas>=2.0.0 polars>=0.19.0 websockets pyarrow sqlglot | |
| - name: Remove local rayforce package to force pip installation | |
| run: | | |
| # Remove local rayforce directory to ensure we test against installed wheel | |
| rm -rf rayforce/__pycache__ | |
| rm -rf rayforce/*.so rayforce/*.dylib rayforce/*.dll | |
| rm -rf rayforce/plugins/*.so rayforce/plugins/*.dylib rayforce/plugins/*.dll | |
| # Move rayforce directory out of Python path temporarily | |
| if [ -d "rayforce" ]; then | |
| mv rayforce rayforce.local | |
| fi | |
| - name: Install and test wheel | |
| run: | | |
| PYVER=$(echo '${{ matrix.python-version }}' | tr -d '.') | |
| WHEEL_FILE=$(find wheels -name "*cp${PYVER}*.whl" | head -1) | |
| if [ -z "$WHEEL_FILE" ]; then | |
| echo "Error: No wheel file found for Python ${{ matrix.python-version }}" | |
| find wheels -name "*.whl" || echo "No wheel files found" | |
| exit 1 | |
| fi | |
| echo "Installing wheel: $WHEEL_FILE" | |
| pip install "$WHEEL_FILE" --force-reinstall --no-deps | |
| python -m pytest -x -vv tests/ | |
| publish: | |
| name: Publish to PyPI | |
| needs: test_wheels | |
| runs-on: ubuntu-22.04 | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| id-token: write | |
| contents: read | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/rayforce-py | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Download all wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: wheels | |
| - name: Prepare distribution directory | |
| run: | | |
| mkdir -p dist | |
| find wheels -name "*.whl" -exec cp {} dist/ \; | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| echo "Extracted version: ${VERSION}" | |
| - name: Announce release on Zulip | |
| if: success() | |
| env: | |
| ZULIP_BOT_TOKEN: ${{ secrets.ZULIP_RELEASES_BOT_TOKEN }} | |
| run: | | |
| chmod +x scripts/announce-release.sh | |
| ./scripts/announce-release.sh "${{ steps.version.outputs.version }}" "${{ secrets.ZULIP_RELEASES_BOT_TOKEN }}" |