Skip to content

Release to PyPI

Release to PyPI #18

Workflow file for this run

name: Release to PyPI
on:
pull_request:
workflow_dispatch:
jobs:
BuildWheel:
name: BuildWheel-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14, macos-14-large]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# When re-running a PR job, GitHub Actions uses the merge commit created at
# the time of the original run, not a fresh merge with the latest target branch.
# This step ensures we always test against the most recent target branch.
- name: Merge with latest target branch (pull_request only)
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
git merge --no-edit origin/${{ github.event.pull_request.base.ref }}
- name: Cache Ccache Directory (pull_request)
if: ${{ github.event_name == 'pull_request' }}
uses: actions/cache@v4
with:
path: |
~/.ccache
key: ccache-${{ runner.os }}-${{ github.event.pull_request.head.ref }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-${{ github.event.pull_request.head.ref }}-
ccache-${{ runner.os }}-${{ github.event.pull_request.base.ref }}-
- name: Set Ccache Directory
run: |
echo "Start building---------------------------------"
export CCACHE_DIR="${HOME}/.ccache"
- name: Build Wheels
uses: pypa/cibuildwheel@v3.3.0
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CMAKE_CUDA_COMPILER_LAUNCHER: ccache
# DO NOT enable this line because the script for conda build is not
# executed in a interactive shell, and "~" will not be expanded to the
# home directory. Export CCACHE_DIR in the run command instead.
# CCACHE_DIR: ~/.ccache
CCACHE_MAXSIZE: 1G # The limit of actions/cache is 10GB
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl