Skip to content

Migrate mostrobotpy to semiwrap #353

Migrate mostrobotpy to semiwrap

Migrate mostrobotpy to semiwrap #353

Workflow file for this run

---
name: dist
on:
pull_request:
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
SCCACHE_WEBDAV_ENDPOINT: "https://frcmaven.wpi.edu/artifactory/wpilib-generic-cache-cmake-local"
SCCACHE_WEBDAV_KEY_PREFIX: "sccache-robotpy"
jobs:
# This job limits concurrency on the default branch
# - we want it to run so it can populate ccache, but we typically
# don't care about when it completes, so limit its concurrency
# to stop eating up valuable + slow Windows/macOS runners
setup_concurrency:
runs-on: ubuntu-latest
outputs:
max-parallel: ${{ steps.max-parallel.outputs.p }}
steps:
- name: Setup concurrency
shell: bash
id: max-parallel
run: |
if [[ "${{ github.ref_name }}" == "main" ]]; then
echo "PARALLEL=1"
echo "p={\"v\": 1}" >> $GITHUB_OUTPUT
else
echo "PARALLEL=10000"
echo "p={\"v\": 10000}" >> $GITHUB_OUTPUT
fi
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install deps
shell: bash
run: |
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
# - name: Check pyproject / rdev synchronization
# shell: bash
# run: |
# ./rdev.sh ci check-pyproject
#
# Build other wheels first (OS-specific, not python specific)
#
build-other:
runs-on: ${{ matrix.os }}
needs: [setup_concurrency]
strategy:
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
fail-fast: true
matrix:
os: ["ubuntu-22.04", "ubuntu-22.04-arm", "macos-14", "windows-2022"]
include:
- os: ubuntu-22.04-arm
container: python:3.13-bookworm
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.13'
if: matrix.os != 'ubuntu-22.04-arm'
- name: Install deps
shell: bash
run: |
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
- name: Build + test wheels
shell: bash
run: |
./rdev.sh ci build-other-wheels
- uses: actions/upload-artifact@v4
with:
name: "pypi-other-${{ runner.os }}-${{ runner.arch }}"
path: dist
#
# Build meson wheels
#
build-meson:
runs-on: ${{ matrix.os }}
needs: [setup_concurrency, build-other]
strategy:
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
fail-fast: true
matrix:
os: ["ubuntu-22.04", "macos-14", "windows-2022"]
python_version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- uses: actions/download-artifact@v4
with:
name: "pypi-other-${{ runner.os }}-${{ runner.arch }}"
path: dist-other
#
# Setup build caching
#
- name: Set ccache params
shell: bash
id: ccache
env:
OS: ${{ runner.os }}
run: |
if [[ "$OS" == "macOS" ]]; then
echo "SCCACHE_CACHE_MULTIARCH=1" >> $GITHUB_ENV
fi
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.7
- name: Install deps
shell: bash
run: |
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
- name: Install numpy (needed for stubgen but broken in raspbian CI)
shell: bash
run: |
python -m pip --disable-pip-version-check install numpy
- name: Build + test wheels
shell: bash
run: |
./rdev.sh ci build-meson-wheels
env:
SCCACHE_WEBDAV_USERNAME: ${{ secrets.WPI_ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.WPI_ARTIFACTORY_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: "pypi-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python_version }}"
path: dist
build-arm:
runs-on: ubuntu-22.04-arm
needs: [setup_concurrency, build-other]
strategy:
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
fail-fast: true
matrix:
python_version:
- '3.11'
- '3.12'
- '3.13'
container: python:${{ matrix.python_version }}-bookworm
steps:
- run: apt-get update && apt-get install -y libgl1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: "pypi-other-${{ runner.os }}-${{ runner.arch }}"
path: dist-other
#
# Setup build caching
#
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.7
# See https://github.com/pypa/setuptools_scm/issues/784
- name: Set git directory as safe to allow setuptools-scm to work
shell: bash
run: |
/usr/bin/git config --global --add safe.directory $PWD
- name: Install deps
shell: bash
run: |
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
- name: Install numpy (needed for stubgen)
shell: bash
run: |
python -m pip --disable-pip-version-check install numpy
- name: Build + test wheels
shell: bash
run: |
./rdev.sh ci build-meson-wheels
env:
SCCACHE_WEBDAV_USERNAME: ${{ secrets.WPI_ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.WPI_ARTIFACTORY_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: "pypi-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python_version }}"
path: dist
#
# Build roboRIO/raspbian wheels
#
# cross-build:
# runs-on: ubuntu-latest
# needs: [setup_concurrency]
# strategy:
# max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
# matrix:
# os:
# - container: wpilib/roborio-cross-ubuntu:2025-22.04-py313
# name: roborio
# - container: wpilib/raspbian-cross-ubuntu:2025-bookworm-22.04-py311
# name: raspbian-py311
# - container: wpilib/raspbian-cross-ubuntu:2025-bookworm-22.04-py312
# name: raspbian-py312
# - container: wpilib/raspbian-cross-ubuntu:2025-bookworm-22.04-py313
# name: raspbian-py313
# container:
# image: "${{ matrix.os.container }}"
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - run: apt-get update
# - name: Setup ccache
# uses: hendrikmuhs/ccache-action@v1.2
# with:
# key: ${{ matrix.os.container }}
# variant: ccache
# # See https://github.com/pypa/setuptools_scm/issues/784
# - name: Set git directory as safe to allow setuptools-scm to work
# shell: bash
# run: |
# pwd
# /usr/bin/git config --global --add safe.directory $(pwd)
# # See https://github.com/pallets/markupsafe/issues/475
# - name: Install MarkupSafe
# shell: bash
# run: |
# /build/venv/bin/cross-pip install --no-build-isolation "markupsafe; python_version < '3.12'"
# - name: Install deps
# shell: bash
# run: |
# /build/venv/bin/cross-pip --disable-pip-version-check install -r rdev_requirements.txt
# - name: Build wheels
# shell: bash
# run: |
# /build/venv/bin/cross-python -m devtools ci build-other-wheels --no-test
# /build/venv/bin/cross-python -m devtools ci build-meson-wheels --no-test
# - uses: actions/upload-artifact@v4
# with:
# name: cross-${{ matrix.os.name }}
# path: dist
# #
# # Publish wheels to wpilib artifactory, pypi
# #
# publish-rpyrepo:
# runs-on: ubuntu-latest
# needs: [check, build, build-arm, cross-build]
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
# steps:
# - uses: actions/download-artifact@v4
# with:
# pattern: cross-*
# path: dist/
# merge-multiple: true
# - uses: pypa/gh-action-pypi-publish@release/v1
# with:
# verify-metadata: false
# user: ${{ secrets.WPI_ARTIFACTORY_USERNAME }}
# password: ${{ secrets.WPI_ARTIFACTORY_TOKEN }}
# repository-url: https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025-local
# publish-pypi:
# runs-on: ubuntu-latest
# needs: [check, build-meson, build-arm, cross-build]
# permissions:
# id-token: write
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - uses: actions/download-artifact@v4
# with:
# pattern: pypi-*
# path: dist/
# merge-multiple: true
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# verify-metadata: false
# ping-rtd:
# runs-on: ubuntu-latest
# needs: [check, build-meson, cross-build]
# if: |
# github.event_name == 'push' &&
# (startsWith(github.event.ref, 'refs/tags') || github.event.ref == 'refs/heads/main')
# steps:
# - name: Sleep 1 minute to allow artifact upload
# shell: bash
# run: sleep 60
# - name: Ping readthedocs
# uses: robotpy/build-actions/ping-rtd@v2024
# with:
# token: ${{ secrets.RTD_TOKEN }}
# webhook: ${{ secrets.RTD_WEBHOOK }}
# ping-meta:
# runs-on: ubuntu-latest
# needs: [publish-rpyrepo, publish-pypi]
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
# steps:
# - uses: peter-evans/repository-dispatch@v3
# with:
# token: ${{ secrets.META_REPO_ACCESS_TOKEN }}
# repository: robotpy/robotpy-meta
# event-type: tag
# client-payload: '{"package_name": "mostrobotpy", "package_version": "${{ github.ref_name }}"}'