fix: ensure workflows checkout exact tag for clean version detection #229
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 Wheels | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: "10.15" | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, macos-14-large, windows-latest, ubuntu-22.04-arm] | |
| cibw_archs: ["auto64"] | |
| cibw_build: ["cp310", "cp311", "cp312", "cp313"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| name: Check out | |
| with: | |
| fetch-depth: 0 # Fetch all history for setuptools-scm | |
| fetch-tags: true # Explicitly fetch tags | |
| - name: Fetch git tags | |
| run: git fetch --force --tags | |
| shell: bash | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| name: Add MSVS Path | |
| - uses: actions/setup-python@v4 | |
| name: Install Python | |
| with: | |
| python-version: '3.11' | |
| - name: Update version files | |
| run: | | |
| python -m pip install setuptools-scm | |
| python scripts/update_versions.py | |
| shell: bash | |
| - name: Install cibuildwheel | |
| run: | | |
| python -m pip install cibuildwheel delvewheel wheel | |
| - name: Building wheels | |
| run: | | |
| python -m cibuildwheel --output-dir dist | |
| env: | |
| CIBW_BUILD: ${{ matrix.cibw_build }}-* | |
| CIBW_BUILD_VERBOSITY: 3 | |
| CIBW_SKIP: "*musllinux*" | |
| CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
| CIBW_BEFORE_ALL_MACOS: bash ci-utils/install_prereq_linux.sh && | |
| mkdir -p /tmp/filepattern_bld && | |
| cp -r local_install /tmp/filepattern_bld | |
| CIBW_BEFORE_ALL_LINUX: bash ci-utils/install_prereq_linux.sh && | |
| mkdir -p /tmp/filepattern_bld && | |
| cp -r local_install /tmp/filepattern_bld | |
| CIBW_BEFORE_ALL_WINDOWS: ci-utils\install_prereq_win.bat && | |
| xcopy /E /I /y local_install C:\TEMP\filepattern_bld\local_install | |
| CIBW_ENVIRONMENT_MACOS: REPAIR_LIBRARY_PATH="/tmp/filepattern_bld/local_install/lib:/tmp/filepattern_bld/local_install/lib64" ON_GITHUB="TRUE" FILEPATTERN_DEP_DIR="/tmp/filepattern_bld/local_install" | |
| CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH="/tmp/filepattern_bld/local_install/lib:/tmp/filepattern_bld/local_install/lib64:$LD_LIBRARY_PATH" ON_GITHUB="TRUE" FILEPATTERN_DEP_DIR="/tmp/filepattern_bld/local_install" | |
| CIBW_ENVIRONMENT_WINDOWS: PATH="$TEMP\\filepattern\\bin;$PATH" ON_GITHUB="TRUE" FILEPATTERN_DEP_DIR="C:\\TEMP\\filepattern_bld\\local_install" | |
| CIBW_REPAIR_WHEEL_COMMAND_MACOS: DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps {wheel} && DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel} | |
| CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
| CIBW_TEST_REQUIRES: pytest pydantic | |
| CIBW_TEST_COMMAND: pytest {project}/tests/ | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: filepattern-wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}-${{ matrix.cibw_build }} | |
| path: dist/*.whl | |
| retention-days: 1 | |
| build_wheels_apple_arm64: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: "11.0" | |
| strategy: | |
| matrix: | |
| os: [macos-14] | |
| cibw_archs: ["arm64"] | |
| cibw_build: ["cp310", "cp311", "cp312", "cp313"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| name: Check out | |
| with: | |
| fetch-depth: 0 # Fetch all history for setuptools-scm | |
| fetch-tags: true # Explicitly fetch tags | |
| - name: Fetch git tags | |
| run: git fetch --force --tags | |
| shell: bash | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| name: Add MSVS Path | |
| - uses: actions/setup-python@v4 | |
| name: Install Python | |
| with: | |
| python-version: '3.11' | |
| - name: Update version files | |
| run: | | |
| python -m pip install setuptools-scm | |
| python scripts/update_versions.py | |
| shell: bash | |
| - name: Install cibuildwheel | |
| run: | | |
| python -m pip install cibuildwheel delvewheel wheel | |
| - name: Building wheels | |
| run: | | |
| python -m cibuildwheel --output-dir dist | |
| env: | |
| CIBW_BUILD: ${{ matrix.cibw_build }}-* | |
| CIBW_BUILD_VERBOSITY: 3 | |
| CIBW_ARCHS_MACOS: arm64 | |
| CIBW_BEFORE_ALL_MACOS: bash ci-utils/install_prereq_linux.sh && | |
| mkdir -p /tmp/filepattern_bld && | |
| cp -r local_install /tmp/filepattern_bld | |
| CIBW_ENVIRONMENT_MACOS: >- | |
| MACOSX_DEPLOYMENT_TARGET=11.0 | |
| REPAIR_LIBRARY_PATH="/tmp/filepattern_bld/local_install/lib:/tmp/filepattern_bld/local_install/lib64" | |
| ON_GITHUB="TRUE" | |
| FILEPATTERN_DEP_DIR="/tmp/filepattern_bld/local_install" | |
| CIBW_REPAIR_WHEEL_COMMAND_MACOS: DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps {wheel} && DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel} | |
| CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
| CIBW_TEST_REQUIRES: pytest pydantic | |
| CIBW_TEST_COMMAND: pytest {project}/tests/ | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: filepattern-wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}-${{ matrix.cibw_build }} | |
| path: dist/*.whl | |
| retention-days: 1 |