From d32a41d72806ed2a32e4a7ac88b0870e8bd192a1 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Thu, 2 Apr 2026 19:15:22 -0400 Subject: [PATCH] Normalize cpp and rust --- cpp/.github/workflows/build.yaml.jinja | 58 ++++++++++--------- cpp/Makefile.jinja | 14 ++--- cppjswasm/.github/workflows/build.yaml.jinja | 39 +++++++------ rust/.github/workflows/build.yaml.jinja | 4 +- rustjswasm/.github/workflows/build.yaml.jinja | 4 +- 5 files changed, 64 insertions(+), 55 deletions(-) diff --git a/cpp/.github/workflows/build.yaml.jinja b/cpp/.github/workflows/build.yaml.jinja index f1219d9..760ff66 100644 --- a/cpp/.github/workflows/build.yaml.jinja +++ b/cpp/.github/workflows/build.yaml.jinja @@ -84,33 +84,6 @@ jobs: run: make checks if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' - - name: Install build dependencies - run: pip install cibuildwheel - - - name: Build (Linux) - run: make build-cibw - env: - CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-manylinux*"{% endraw %} - CIBW_BUILD_VERBOSITY: 3 - if: matrix.os == 'ubuntu-latest' - - - name: Build (Macos) - run: make build-cibw - env: - CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-macos*"{% endraw %} - CIBW_BUILD_VERBOSITY: 3 - if: matrix.os == 'macos-latest' - - - name: Build (Windows) - run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - make build-cibw - shell: cmd - env: - CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-win_amd64"{% endraw %} - CIBW_BEFORE_ALL: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - if: matrix.os == 'windows-latest' - - name: Test run: make coverage @@ -132,6 +105,37 @@ jobs: with: token: {% raw %}${{ secrets.CODECOV_TOKEN }}{% endraw %} + - name: Install build dependencies + run: pip install cibuildwheel + + - name: Make dist (Linux) + run: | + make dist-py-sdist + make dist-py-wheel + make dist-check + env: + CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-manylinux*"{% endraw %} + CIBW_BUILD_VERBOSITY: 3 + if: matrix.os == 'ubuntu-latest' + + - name: Make dist (Macos) + run: | + make dist-py-wheel + env: + CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-macos*"{% endraw %} + CIBW_BUILD_VERBOSITY: 3 + if: matrix.os == 'macos-latest' + + - name: Make dist (Windows) + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + make dist-py-wheel + shell: cmd + env: + CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-win_amd64"{% endraw %} + CIBW_BEFORE_ALL: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + if: matrix.os == 'windows-latest' + - uses: actions/upload-artifact@v7 with: name: {% raw %}dist-${{matrix.os}}-${{matrix.python-version}}{% endraw %} diff --git a/cpp/Makefile.jinja b/cpp/Makefile.jinja index 9be1ca0..b6ff04a 100644 --- a/cpp/Makefile.jinja +++ b/cpp/Makefile.jinja @@ -12,9 +12,6 @@ build-py: build-cpp: python -m hatchling build --hooks-only -build-cibw: - python -m cibuildwheel --output-dir dist - build: build-cpp build-py ## build the project .PHONY: install @@ -114,15 +111,18 @@ major: ## bump a major version ######## # DIST # ######## -.PHONY: dist dist-py dist-check publish +.PHONY: dist-py-wheel dist-py-sdist dist-check dist publish + +dist-py-wheel: ## build python wheel + python -m cibuildwheel --output-dir dist -dist-py: ## build python dists - python -m build -w -s +dist-py-sdist: ## build python sdist + python -m build --sdist -o dist dist-check: ## run python dist checker with twine python -m twine check dist/* -dist: clean build dist-js dist-py dist-check ## build all dists +dist: clean build dist-py-wheel dist-py-sdist dist-check ## build all dists publish: dist ## publish python assets diff --git a/cppjswasm/.github/workflows/build.yaml.jinja b/cppjswasm/.github/workflows/build.yaml.jinja index 531fc31..ebb0b29 100644 --- a/cppjswasm/.github/workflows/build.yaml.jinja +++ b/cppjswasm/.github/workflows/build.yaml.jinja @@ -66,9 +66,6 @@ jobs: run: make checks if: matrix.os == 'ubuntu-latest' - - name: Build - run: make build - - name: Test run: make coverage @@ -76,44 +73,52 @@ jobs: uses: actions/upload-artifact@v7 with: name: {% raw %}test-results-${{ matrix.os }}-${{ matrix.python-version }}{% endraw %} - path: '**/junit.xml' - if: matrix.os == 'ubuntu-latest' + path: junit.xml + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' - name: Publish Unit Test Results uses: EnricoMi/publish-unit-test-result-action@v2 with: files: '**/junit.xml' - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' - name: Upload coverage uses: codecov/codecov-action@v6 with: token: {% raw %}${{ secrets.CODECOV_TOKEN }}{% endraw %} - - name: Set up QEMU - uses: docker/setup-qemu-action@v4 - with: - platforms: all - if: runner.os == 'Linux' && runner.arch == 'X64' + - name: Install build dependencies + run: pip install cibuildwheel - - name: Make dist + - name: Make dist (Linux) run: | make dist-py-sdist make dist-py-wheel make dist-check env: CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-manylinux*"{% endraw %} + CIBW_BUILD_VERBOSITY: 3 if: matrix.os == 'ubuntu-latest' - - name: Make dist + - name: Make dist (Macos) run: | make dist-py-wheel - make dist-check env: - CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.0 - if: matrix.os != 'ubuntu-latest' + CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-macos*"{% endraw %} + CIBW_BUILD_VERBOSITY: 3 + if: matrix.os == 'macos-latest' + + - name: Make dist (Windows) + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + make dist-py-wheel + shell: cmd + env: + CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-win_amd64"{% endraw %} + CIBW_BEFORE_ALL: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + if: matrix.os == 'windows-latest' - uses: actions/upload-artifact@v7 with: - name: {% raw %}dist-${{matrix.os}}{% endraw %} + name: {% raw %}dist-${{matrix.os}}-${{matrix.python-version}}{% endraw %} path: dist diff --git a/rust/.github/workflows/build.yaml.jinja b/rust/.github/workflows/build.yaml.jinja index 03338b3..f26b18a 100644 --- a/rust/.github/workflows/build.yaml.jinja +++ b/rust/.github/workflows/build.yaml.jinja @@ -81,7 +81,7 @@ jobs: platforms: all if: runner.os == 'Linux' && runner.arch == 'X64' - - name: Make dist + - name: Make dist (Linux) run: | make dist-rs make dist-py-sdist @@ -89,7 +89,7 @@ jobs: make dist-check if: matrix.os == 'ubuntu-latest' - - name: Make dist + - name: Make dist (Macos / Windows) run: | make dist-py-wheel make dist-check diff --git a/rustjswasm/.github/workflows/build.yaml.jinja b/rustjswasm/.github/workflows/build.yaml.jinja index 809bf1d..931565d 100644 --- a/rustjswasm/.github/workflows/build.yaml.jinja +++ b/rustjswasm/.github/workflows/build.yaml.jinja @@ -88,7 +88,7 @@ jobs: platforms: all if: runner.os == 'Linux' && runner.arch == 'X64' - - name: Make dist + - name: Make dist (Linux) run: | make dist-rs make dist-py-sdist @@ -98,7 +98,7 @@ jobs: CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-manylinux*"{% endraw %} if: matrix.os == 'ubuntu-latest' - - name: Make dist + - name: Make dist (Macos / Windows) run: | make dist-py-wheel make dist-check