Improve __repr__ for various objects #635
Workflow file for this run
This file contains 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: | |
branches: | |
- master | |
pull_request: | |
types: [ assigned, opened, synchronize, reopened ] | |
release: | |
types: [ published, edited ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build on ${{ matrix.config.os }} ${{ matrix.config.arch }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
matrix: | |
config: [ | |
{os: ubuntu-latest}, | |
{os: macos-13, arch: x86_64}, | |
{os: macos-13, arch: arm64}, | |
{os: windows-latest}, | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set macOS env | |
if: ${{ startsWith(matrix.config.os, 'macos') }} | |
run: | | |
if [[ ${{ matrix.config.arch }} == "x86_64" ]]; then | |
VCPKG_TARGET_TRIPLET="x64-osx" | |
elif [[ ${{ matrix.config.arch }} == "arm64" ]]; then | |
VCPKG_TARGET_TRIPLET="arm64-osx-release" | |
else | |
exit 1 | |
fi | |
echo "VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" >> "$GITHUB_ENV" | |
VCPKG_INSTALLATION_ROOT="/Users/runner/work/vcpkg" | |
CMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" | |
CMAKE_OSX_ARCHITECTURES=${{ matrix.config.arch }} | |
echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "$GITHUB_ENV" | |
echo "CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" >> "$GITHUB_ENV" | |
echo "CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}" >> "$GITHUB_ENV" | |
# Fix: cibuildhweel cannot interpolate env variables. | |
CONFIG_SETTINGS="cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" | |
CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" | |
CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}" | |
echo "CIBW_CONFIG_SETTINGS_MACOS=${CONFIG_SETTINGS}" >> "$GITHUB_ENV" | |
- name: Set Windows env | |
if: ${{ startsWith(matrix.config.os, 'windows') }} | |
shell: pwsh | |
run: | | |
$CMAKE_TOOLCHAIN_FILE = "${env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" | |
echo "CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" >> "${env:GITHUB_ENV}" | |
$VCPKG_TARGET_TRIPLET = "x64-windows" | |
echo "VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" >> "${env:GITHUB_ENV}" | |
# Fix: cibuildhweel cannot interpolate env variables. | |
$CMAKE_TOOLCHAIN_FILE = $CMAKE_TOOLCHAIN_FILE.replace('\', '/') | |
$CONFIG_SETTINGS = "cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" | |
$CONFIG_SETTINGS = "${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" | |
echo "CIBW_CONFIG_SETTINGS_WINDOWS=${CONFIG_SETTINGS}" >> "${env:GITHUB_ENV}" | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS_MACOS: ${{ matrix.config.arch }} | |
- name: Archive wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pycolmap-${{ matrix.config.os }}-${{ matrix.config.arch }} | |
path: wheelhouse/pycolmap-*.whl | |
pypi-publish: | |
name: Publish wheels to PyPI | |
needs: build | |
runs-on: ubuntu-latest | |
# We publish the wheel to pypi when a new tag is pushed, | |
# either by creating a new GitHub release or explictly with `git tag` | |
if: ${{ github.event_name == 'release' || startsWith(github.ref, 'refs/tags') }} | |
steps: | |
- name: Download wheels | |
uses: actions/download-artifact@v3 | |
with: | |
path: ./artifacts/ | |
- name: Move wheels | |
run: mkdir ./wheelhouse && mv ./artifacts/**/*.whl ./wheelhouse/ | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip_existing: true | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages_dir: ./wheelhouse/ |