Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 17 additions & 42 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,25 @@ jobs:
strategy:
fail-fast: false
matrix:
ubuntu: ["22.04", "24.04"]
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
arch: ["amd64", "arm64"]
include:
# ── Ubuntu 22.04 ──
- ubuntu: "22.04"
python: "3.9"
numpy: "2.0.0"
- ubuntu: "22.04"
python: "3.10"
numpy: "2.0.0"
- ubuntu: "22.04"
python: "3.11"
numpy: "2.0.0"
- ubuntu: "22.04"
python: "3.12"
numpy: "2.0.0"
- ubuntu: "22.04"
python: "3.13"
numpy: "2.1.0"
- ubuntu: "22.04"
python: "3.14"
numpy: "2.3.2"
# numpy pinned per python version
- { python: "3.9", numpy: "2.0.0" }
- { python: "3.10", numpy: "2.0.0" }
- { python: "3.11", numpy: "2.0.0" }
- { python: "3.12", numpy: "2.0.0" }
- { python: "3.13", numpy: "2.1.0" }
- { python: "3.14", numpy: "2.3.2" }
# runner + tag_suffix per arch (arm runner label is ubuntu-version-specific)
- { arch: "amd64", runner: "ubuntu-latest", tag_suffix: "" }
- { ubuntu: "22.04", arch: "arm64", runner: "ubuntu-22.04-arm", tag_suffix: "-arm64" }
- { ubuntu: "24.04", arch: "arm64", runner: "ubuntu-24.04-arm", tag_suffix: "-arm64" }

# ── Ubuntu 24.04 ──
- ubuntu: "24.04"
python: "3.9"
numpy: "2.0.0"
- ubuntu: "24.04"
python: "3.10"
numpy: "2.0.0"
- ubuntu: "24.04"
python: "3.11"
numpy: "2.0.0"
- ubuntu: "24.04"
python: "3.12"
numpy: "2.0.0"
- ubuntu: "24.04"
python: "3.13"
numpy: "2.1.0"
- ubuntu: "24.04"
python: "3.14"
numpy: "2.3.2"

runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
container:
image: cubertgmbh/cuvis_base:${{ needs.prepare.outputs.cuvis_version }}-ubuntu${{ matrix.ubuntu }}
image: cubertgmbh/cuvis_base:${{ needs.prepare.outputs.cuvis_version }}-ubuntu${{ matrix.ubuntu }}${{ matrix.tag_suffix }}
steps:
- name: Install system build dependencies
run: |
Expand Down Expand Up @@ -112,4 +87,4 @@ jobs:
run: |
OUTPUT=$(python -c "from cuvis_il import cuvis_il; print(cuvis_il.cuvis_version_swig())")
echo "Version output: $OUTPUT"
echo "$OUTPUT" | grep -q "CUBERT SDK" || (echo "Version check failed!" && exit 1)
echo "$OUTPUT" | grep -q "CUBERT SDK" || (echo "Version check failed!" && exit 1)
128 changes: 48 additions & 80 deletions .github/workflows/publish_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,112 +38,80 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
# ── Ubuntu 22.04 ──
- ubuntu: "22.04"
python: "3.9"
numpy: "2.0.0"
platform_tag: "manylinux_2_35_x86_64"
- ubuntu: "22.04"
python: "3.10"
numpy: "2.0.0"
platform_tag: "manylinux_2_35_x86_64"
- ubuntu: "22.04"
python: "3.11"
numpy: "2.0.0"
platform_tag: "manylinux_2_35_x86_64"
- ubuntu: "22.04"
python: "3.12"
numpy: "2.0.0"
platform_tag: "manylinux_2_35_x86_64"
- ubuntu: "22.04"
python: "3.13"
numpy: "2.1.0"
platform_tag: "manylinux_2_35_x86_64"
- ubuntu: "22.04"
python: "3.14"
numpy: "2.3.2"
platform_tag: "manylinux_2_35_x86_64"

# ── Ubuntu 24.04 ──
- ubuntu: "24.04"
python: "3.9"
numpy: "2.0.0"
platform_tag: "manylinux_2_39_x86_64"
- ubuntu: "24.04"
python: "3.10"
numpy: "2.0.0"
platform_tag: "manylinux_2_39_x86_64"
- ubuntu: "24.04"
python: "3.11"
numpy: "2.0.0"
platform_tag: "manylinux_2_39_x86_64"
- ubuntu: "24.04"
python: "3.12"
numpy: "2.0.0"
platform_tag: "manylinux_2_39_x86_64"
- ubuntu: "24.04"
python: "3.13"
numpy: "2.1.0"
platform_tag: "manylinux_2_39_x86_64"
- ubuntu: "24.04"
python: "3.14"
numpy: "2.3.2"
platform_tag: "manylinux_2_39_x86_64"
ubuntu: ["22.04", "24.04"]
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
arch: ["amd64", "arm64"]
include:
# numpy pinned per python version
- { python: "3.9", numpy: "2.0.0" }
- { python: "3.10", numpy: "2.0.0" }
- { python: "3.11", numpy: "2.0.0" }
- { python: "3.12", numpy: "2.0.0" }
- { python: "3.13", numpy: "2.1.0" }
- { python: "3.14", numpy: "2.3.2" }
# runner + tag_suffix per arch (arm runner label is ubuntu-version-specific)
- { arch: "amd64", runner: "ubuntu-latest", tag_suffix: "" }
- { ubuntu: "22.04", arch: "arm64", runner: "ubuntu-22.04-arm", tag_suffix: "-arm64" }
- { ubuntu: "24.04", arch: "arm64", runner: "ubuntu-24.04-arm", tag_suffix: "-arm64" }
# platform tag per ubuntu+arch combination
- { ubuntu: "22.04", arch: "amd64", platform_tag: "manylinux_2_35_x86_64" }
- { ubuntu: "24.04", arch: "amd64", platform_tag: "manylinux_2_39_x86_64" }
- { ubuntu: "22.04", arch: "arm64", platform_tag: "manylinux_2_35_aarch64" }
- { ubuntu: "24.04", arch: "arm64", platform_tag: "manylinux_2_39_aarch64" }

runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
container:
image: cubertgmbh/cuvis_base:${{ needs.prepare.outputs.cuvis_version }}-ubuntu${{ matrix.ubuntu }}
image: cubertgmbh/cuvis_base:${{ needs.prepare.outputs.cuvis_version }}-ubuntu${{ matrix.ubuntu }}${{ matrix.tag_suffix }}

permissions:
contents: read

steps:
- name: Install system build dependencies
run: |
apt-get update
apt-get install -y software-properties-common gnupg g++ swig cmake

- name: Add Deadsnakes PPA and install Python ${{ matrix.python }}
run: |
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update
apt-get install -y python${{ matrix.python }}-dev python${{ matrix.python }}-venv

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
submodules: recursive

- name: Set up Python virtual environment
run: |
python${{ matrix.python }} -m venv /tmp/venv
echo "/tmp/venv/bin" >> "$GITHUB_PATH"

- name: Install Python build dependencies
run: |
pip install --upgrade pip setuptools wheel build
pip install numpy==${{ matrix.numpy }}

- name: CMake configure and build
run: |
cmake -DCMAKE_BUILD_TYPE=Release \
-DDOXYGEN_BUILD_DOCUMENTATION=FALSE \
-DPython_ROOT_DIR=/tmp/venv \
-B build .
cmake --build build --target cuvis_pyil --config Release

- name: Copy built files and package wheel
run: |
rm -rf ./cuvis_il/*cuvis*
rm -rf ./dist/*.whl

chmod +x ./copy_pyil_files.sh
./copy_pyil_files.sh build

python -m build --wheel --no-isolation

- name: Tag wheel with correct Python and platform tags
run: |
PYTHON_TAG="py$(echo '${{ matrix.python }}' | tr -d '.')"
Expand All @@ -158,11 +126,11 @@ jobs:
--python-tag="$PYTHON_TAG" \
--platform-tag=${{ matrix.platform_tag }} \
"$WHEELS"

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel-ubuntu${{ matrix.ubuntu }}-py${{ matrix.python }}
name: wheel-ubuntu${{ matrix.ubuntu }}-py${{ matrix.python }}-${{ matrix.arch }}
path: dist/*.whl

preflight:
Expand All @@ -171,13 +139,13 @@ jobs:

permissions:
contents: read

steps:
- name: Checkout (for pyproject.toml)
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}

- name: Read package name/version
id: meta
run: |
Expand All @@ -203,14 +171,14 @@ jobs:
run: |
python3 - <<'PY'
import json, os, sys, urllib.request, urllib.error

name = os.environ["NAME"]
version = os.environ["VERSION"]
target = os.environ["TARGET"]

base = "https://pypi.org/pypi" if target == "pypi" else "https://test.pypi.org/pypi"
url = f"{base}/{name}/json"

try:
with urllib.request.urlopen(url) as resp:
data = json.load(resp)
Expand All @@ -219,37 +187,37 @@ jobs:
print(f"{name} not found on {target}; OK to publish {version}.")
sys.exit(0)
raise

releases = data.get("releases", {})
if version in releases and releases[version]:
print(f"Version {name}=={version} already exists on {target}. Aborting.")
sys.exit(1)

print(f"Version {name}=={version} not present on {target}; OK to publish.")
PY

# ── Publish (trusted publishing via OIDC) ──
publish:
needs: [prepare, build, preflight]
runs-on: ubuntu-latest

environment: ${{ inputs.repository || 'pypi' }}

permissions:
contents: read
id-token: write

steps:
- name: Download all wheel artifacts
uses: actions/download-artifact@v4
with:
path: dist/
pattern: wheel-*
merge-multiple: true

- name: List wheels to publish
run: ls -lh dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
Expand All @@ -261,4 +229,4 @@ jobs:
|| (inputs.repository == 'pypi'
&& 'https://upload.pypi.org/legacy/'
|| 'https://test.pypi.org/legacy/')
}}
}}
Loading