Skip to content

fix: DART 6.16 iterator invalidation SEGFAULT in Subject/Observer not… #6983

fix: DART 6.16 iterator invalidation SEGFAULT in Subject/Observer not…

fix: DART 6.16 iterator invalidation SEGFAULT in Subject/Observer not… #6983

---
name: Publish dartpy
'on':
push:
branches:
- "main"
- "release-*"
tags:
- "v*.*.*"
paths-ignore:
- ".github/workflows/cache_*.yml"
- "docker/dev/**"
schedule:
- cron: "0 10 * * 0,3"
workflow_dispatch:
inputs:
ref:
description: "Git ref (tag/sha) to build; publishing requires a version tag (v*)"
required: false
default: ""
checkout_ref:
description: "Optional git ref (tag/sha) to checkout for building; defaults to `ref` when set"
required: false
default: ""
publish:
description: "Set to 'true' to publish to PyPI (version tags only)"
required: false
default: "false"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# This workflow will install Python dependencies, run tests and lint with a
# variety of Python versions. For more information see:
# - https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# - https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
jobs:
check_format:
name: Check format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.checkout_ref || github.event.inputs.ref || github.ref }}
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black -U
pip install isort -U
- name: Check format
run: |
black --check --diff .
- name: Check import
run: |
isort --check --diff .
build_wheels:
name: ${{ matrix.os }}-${{ matrix.build }}
runs-on: ${{ matrix.runner }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
# Linux wheels require a container engine (docker/podman). Some of our
# self-hosted runners do not have docker installed, so run Linux wheel
# builds on a GitHub-hosted runner image that includes docker.
- os: ubuntu-latest
runner: ubuntu-24.04
build: "cp313-manylinux_x86_64"
experimental: false
release_only: false
- os: ubuntu-latest
runner: ubuntu-24.04
build: "cp312-manylinux_x86_64"
experimental: false
release_only: true
- os: ubuntu-latest
runner: ubuntu-24.04
build: "cp311-manylinux_x86_64"
experimental: false
release_only: true
- os: ubuntu-latest
runner: ubuntu-24.04
build: "cp310-manylinux_x86_64"
experimental: false
release_only: true
- os: macos-latest
runner: macos-latest
build: "cp313-macosx_arm64"
experimental: false
release_only: false
- os: macos-latest
runner: macos-latest
build: "cp312-macosx_arm64"
experimental: false
release_only: true
- os: windows-latest
runner: windows-latest
build: "cp313-win_amd64"
experimental: false
release_only: false
- os: windows-latest
runner: windows-latest
build: "cp312-win_amd64"
experimental: false
release_only: true
env:
CIBW_BUILD: ${{ matrix.build }}
CIBW_PRERELEASE_PYTHONS: true
DARTPY_REF: ${{ github.event.inputs.ref || github.ref }}
DARTPY_CHECKOUT_REF: ${{ github.event.inputs.checkout_ref || github.event.inputs.ref || github.ref }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ env.DARTPY_CHECKOUT_REF }}
- name: Validate publish inputs
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' }}
shell: bash
run: |
case "${DARTPY_REF}" in
v*|refs/tags/v*) ;;
*)
echo "::error::When publish=true, ref must be a version tag (e.g. v6.16.1). Got '${DARTPY_REF}'."
exit 1
;;
esac
tag="${DARTPY_REF#refs/tags/}"
tag="${tag#v}"
pkg_version="$(python -c 'import xml.etree.ElementTree as ET; print(ET.parse("package.xml").getroot().findtext("version", default="").strip())')"
if [ -z "${pkg_version}" ]; then
echo "::error::Failed to read version from package.xml in '${DARTPY_CHECKOUT_REF}'."
exit 1
fi
if [ "${pkg_version}" != "${tag}" ]; then
echo "::error::package.xml version '${pkg_version}' does not match tag '${tag}' (ref='${DARTPY_REF}', checkout_ref='${DARTPY_CHECKOUT_REF}')."
exit 1
fi
- name: Set up Vcpkg
if: ${{ matrix.os == 'windows-latest' && (matrix.release_only == false || env.DARTPY_REF == 'refs/heads/main' || env.DARTPY_REF == 'main' || startsWith(env.DARTPY_REF, 'refs/heads/release-') || startsWith(env.DARTPY_REF, 'release-') || startsWith(env.DARTPY_REF, 'refs/tags/v') || startsWith(env.DARTPY_REF, 'v')) }}
uses: johnwason/vcpkg-action@v7
with:
# TODO: Add ode and coin-or-ipopt
pkgs: >-
assimp
eigen3
fcl
fmt
spdlog
bullet3
freeglut
glfw3
imgui[opengl2-binding]
nlopt
opengl
osg
pagmo2
tinyxml2
tracy
urdfdom
triplet: x64-windows
revision: "2025.09.17"
token: ${{ github.token }}
- name: Build wheels
if: ${{ matrix.os != 'windows-latest' && (matrix.release_only == false || env.DARTPY_REF == 'refs/heads/main' || env.DARTPY_REF == 'main' || startsWith(env.DARTPY_REF, 'refs/heads/release-') || startsWith(env.DARTPY_REF, 'release-') || startsWith(env.DARTPY_REF, 'refs/tags/v') || startsWith(env.DARTPY_REF, 'v')) }}
uses: pypa/cibuildwheel@v3.2.0
env:
# macOS
MACOSX_DEPLOYMENT_TARGET: 15.0
# Windows
CMAKE_TOOLCHAIN_FILE: ""
- name: Build wheels (Windows)
if: ${{ matrix.os == 'windows-latest' && (matrix.release_only == false || env.DARTPY_REF == 'refs/heads/main' || env.DARTPY_REF == 'main' || startsWith(env.DARTPY_REF, 'refs/heads/release-') || startsWith(env.DARTPY_REF, 'release-') || startsWith(env.DARTPY_REF, 'refs/tags/v') || startsWith(env.DARTPY_REF, 'v')) }}
uses: pypa/cibuildwheel@v3.2.0
env:
# macOS
MACOSX_DEPLOYMENT_TARGET: 15.0
# Windows
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: ${{ matrix.os }}-${{ matrix.build }}
# TODO: Disabled because installing from source doesn't work when the deps are not
# installed in the system
# build_sdist:
# name: Build source distribution
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v5
# - name: Build SDist
# run: pipx run build --sdist
# - uses: actions/upload-artifact@v4
# with:
# path: dist/*.tar.gz
upload_pypi:
# needs: [build_wheels, build_sdist]
needs: [build_wheels]
runs-on: ubuntu-latest
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# upload to PyPI on every tag starting with 'release-'
# if: github.event_name == 'push' && startsWith(github.ref, 'release-')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' && (startsWith(github.ref, 'refs/tags/v') || startsWith(github.event.inputs.ref, 'v') || startsWith(github.event.inputs.ref, 'refs/tags/v')))
steps:
- uses: actions/download-artifact@v5
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
# name: artifact
path: dist
merge-multiple: true
- name: List files in dist
run: ls -lR dist/
- uses: pypa/gh-action-pypi-publish@v1.13.0
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# To test: repository_url: https://test.pypi.org/legacy/
skip-existing: true