From fcd1c150b116f9cd66579759a18e5c17e23233bf Mon Sep 17 00:00:00 2001 From: "l.feng" <43399351+msclock@users.noreply.github.com> Date: Sun, 15 Dec 2024 13:41:18 +0800 Subject: [PATCH] fix(ci): wheels skip all steps (#69) Signed-off-by: l.feng <43399351+msclock@users.noreply.github.com> --- .github/workflows/cd.yml | 8 ++-- .github/workflows/ci.yml | 5 ++- .github/workflows/reuseable_cibuildwheel.yml | 40 +++++++++---------- pyproject.toml | 2 +- .../workflows/{cd.yml => cd.yml.jinja} | 14 ++++--- .../workflows/ci.yml.jinja | 7 +++- .../workflows/reuseable_cibuildwheel.yml | 40 +++++++++---------- template/pyproject.toml.jinja | 2 +- template/vcpkg.json.jinja | 4 +- vcpkg.json | 4 +- 10 files changed, 67 insertions(+), 59 deletions(-) rename template/[% if repo_platform == 'github' %].github[% endif %]/workflows/{cd.yml => cd.yml.jinja} (83%) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 568a540..20e43a9 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,7 +2,8 @@ name: CD on: workflow_dispatch: - + schedule: + - cron: 0 0 * * 5 release: types: - published @@ -36,8 +37,8 @@ jobs: uses: ./.github/workflows/reuseable_cibuildwheel.yml secrets: inherit with: - auto-archs: true - extral-archs: true + auto: true + extra: true check_dist: @@ -58,6 +59,7 @@ jobs: needs: [build_wheels, build_sdist, check_dist] environment: name: pypi + url: https://pypi.org/project/ss-pybind11 permissions: id-token: write runs-on: ubuntu-latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 017a880..68376d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,8 +78,8 @@ jobs: uses: ./.github/workflows/reuseable_cibuildwheel.yml secrets: inherit with: - auto-archs: true - extral-archs: false + auto: true + extra: false codecov: @@ -174,6 +174,7 @@ jobs: if: always() needs: - wheels + - codecov - check-docs - check-mkdocs-docs runs-on: ubuntu-24.04 diff --git a/.github/workflows/reuseable_cibuildwheel.yml b/.github/workflows/reuseable_cibuildwheel.yml index b64b680..f327399 100644 --- a/.github/workflows/reuseable_cibuildwheel.yml +++ b/.github/workflows/reuseable_cibuildwheel.yml @@ -3,55 +3,55 @@ name: cibuildwheel on: workflow_call: inputs: - auto-archs: + auto: description: Build wheels for auto archs required: true type: boolean - extral-archs: + extra: description: Build wheels for aarch64 armv7l ppc64le & s390x required: true type: boolean jobs: build_wheels: - name: Build ${{ matrix.build }}-${{ matrix.arch }} wheels on ${{ matrix.os }} + name: On ${{ matrix.os }}, with ${{ matrix.arch }}, build ${{ matrix.build }} wheels runs-on: ${{ matrix.os }} strategy: matrix: - build: [manylinux, musllinux] - arch: [aarch64, ppc64le, s390x, armv7l, x86_64, i686] os: [ubuntu-24.04] # renovate: github-runner - use_qemu: [true] + arch: [aarch64, ppc64le, s390x, armv7l, x86_64, i686] + build: [manylinux, musllinux] + qemu_arch: [aarch64 ppc64le s390x armv7l] include: - - {os: windows-2019, arch: AMD64, build: win, use_qemu: false} - - {os: windows-2019, arch: x86, build: win, use_qemu: false} - - {os: windows-2022, arch: ARM64, build: win, use_qemu: false} - - {os: macos-13, arch: x86_64, build: macos, use_qemu: false} - - {os: macos-14, arch: arm64, build: macos, use_qemu: false} + - {os: windows-2019, arch: AMD64, build: win} + - {os: windows-2019, arch: x86, build: win} + - {os: windows-2022, arch: ARM64, build: win} + - {os: macos-13, arch: x86_64, build: macos} + - {os: macos-14, arch: arm64, build: macos} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 if: > - github.event.inputs.extral-archs && matrix.use_qemu || - github.event.inputs.auto-archs && !matrix.use_qemu + inputs.auto && !contains(matrix.qemu_arch, matrix.arch) || + inputs.extra && contains(matrix.qemu_arch, matrix.arch) with: fetch-depth: 0 - name: Set up msvc on Windows - if: runner.os == 'Windows' && github.event.inputs.auto-archs && !matrix.use_qemu + if: runner.os == 'Windows' && inputs.auto && !contains(matrix.qemu_arch, matrix.arch) uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 with: arch: ${{ matrix.arch }} - name: Set up QEMU uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - if: runner.os == 'Linux' && github.event.inputs.extral-archs && matrix.use_qemu + if: runner.os == 'Linux' && inputs.extra && contains(matrix.qemu_arch, matrix.arch) - name: Build wheels if: > - github.event.inputs.extral-archs && matrix.use_qemu || - github.event.inputs.auto-archs && !matrix.use_qemu + inputs.auto && !contains(matrix.qemu_arch, matrix.arch) || + inputs.extra && contains(matrix.qemu_arch, matrix.arch) uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0 env: CIBW_ARCHS: ${{ matrix.arch }} @@ -59,9 +59,9 @@ jobs: - name: Upload wheels if: > - github.event.inputs.extral-archs && matrix.use_qemu || - github.event.inputs.auto-archs && !matrix.use_qemu + inputs.auto && !contains(matrix.qemu_arch, matrix.arch) || + inputs.extra && contains(matrix.qemu_arch, matrix.arch) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 with: - name: cibw-${{ matrix.build }}-${{ matrix.arch }}-${{ matrix.os }} + name: cibw-${{ matrix.os }}-${{ matrix.build }}-${{ matrix.arch }} path: wheelhouse/*.whl diff --git a/pyproject.toml b/pyproject.toml index 53c01e5..1b1b51c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,7 +58,7 @@ metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" sdist.include = ["src/ss_pybind11/_version.py"] cmake.args = [ "-DBUILD_TESTING=OFF", - "-DCMAKE_BUILD_TYPE=ReWithDebInfo", + "-DCMAKE_BUILD_TYPE=Release", "-DVCPKG_INSTALL_REPORT_FAILURE=ON", "-DVCPKG_INSTALL_OPTIONS=--allow-unsupported", "-DCMAKE_TOOLCHAIN_FILE=cmake/vcpkg/vcpkg.toolchain.cmake", diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/cd.yml b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/cd.yml.jinja similarity index 83% rename from template/[% if repo_platform == 'github' %].github[% endif %]/workflows/cd.yml rename to template/[% if repo_platform == 'github' %].github[% endif %]/workflows/cd.yml.jinja index 568a540..ac19949 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/cd.yml +++ b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/cd.yml.jinja @@ -2,13 +2,14 @@ name: CD on: workflow_dispatch: - + schedule: + - cron: 0 0 * * 5 release: types: - published concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: {{ '${{ github.workflow }}-${{ github.ref }}' }} cancel-in-progress: true env: @@ -36,8 +37,8 @@ jobs: uses: ./.github/workflows/reuseable_cibuildwheel.yml secrets: inherit with: - auto-archs: true - extral-archs: true + auto: true + extra: true check_dist: @@ -58,6 +59,7 @@ jobs: needs: [build_wheels, build_sdist, check_dist] environment: name: pypi + url: https://pypi.org/project/{{ repo_name }} permissions: id-token: write runs-on: ubuntu-latest @@ -72,6 +74,6 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 env: - PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + PYPI_API_TOKEN: {{ '${{ secrets.PYPI_API_TOKEN }}' }} with: - password: ${{ secrets.PYPI_API_TOKEN }} + password: {{ '${{ secrets.PYPI_API_TOKEN }}' }} diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja index 118760f..b445890 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja +++ b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja @@ -84,8 +84,8 @@ jobs: uses: ./.github/workflows/reuseable_cibuildwheel.yml secrets: inherit with: - auto-archs: true - extral-archs: false + auto: true + extra: false [%- if use_codecov == true %] @@ -190,6 +190,9 @@ jobs: if: always() needs: - wheels +[%- if use_codecov == true %] + - codecov +[%- endif %] - check-docs [%- if repo_name == 'ss-pybind11' %] - check-mkdocs-docs diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/reuseable_cibuildwheel.yml b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/reuseable_cibuildwheel.yml index b64b680..f327399 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/reuseable_cibuildwheel.yml +++ b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/reuseable_cibuildwheel.yml @@ -3,55 +3,55 @@ name: cibuildwheel on: workflow_call: inputs: - auto-archs: + auto: description: Build wheels for auto archs required: true type: boolean - extral-archs: + extra: description: Build wheels for aarch64 armv7l ppc64le & s390x required: true type: boolean jobs: build_wheels: - name: Build ${{ matrix.build }}-${{ matrix.arch }} wheels on ${{ matrix.os }} + name: On ${{ matrix.os }}, with ${{ matrix.arch }}, build ${{ matrix.build }} wheels runs-on: ${{ matrix.os }} strategy: matrix: - build: [manylinux, musllinux] - arch: [aarch64, ppc64le, s390x, armv7l, x86_64, i686] os: [ubuntu-24.04] # renovate: github-runner - use_qemu: [true] + arch: [aarch64, ppc64le, s390x, armv7l, x86_64, i686] + build: [manylinux, musllinux] + qemu_arch: [aarch64 ppc64le s390x armv7l] include: - - {os: windows-2019, arch: AMD64, build: win, use_qemu: false} - - {os: windows-2019, arch: x86, build: win, use_qemu: false} - - {os: windows-2022, arch: ARM64, build: win, use_qemu: false} - - {os: macos-13, arch: x86_64, build: macos, use_qemu: false} - - {os: macos-14, arch: arm64, build: macos, use_qemu: false} + - {os: windows-2019, arch: AMD64, build: win} + - {os: windows-2019, arch: x86, build: win} + - {os: windows-2022, arch: ARM64, build: win} + - {os: macos-13, arch: x86_64, build: macos} + - {os: macos-14, arch: arm64, build: macos} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 if: > - github.event.inputs.extral-archs && matrix.use_qemu || - github.event.inputs.auto-archs && !matrix.use_qemu + inputs.auto && !contains(matrix.qemu_arch, matrix.arch) || + inputs.extra && contains(matrix.qemu_arch, matrix.arch) with: fetch-depth: 0 - name: Set up msvc on Windows - if: runner.os == 'Windows' && github.event.inputs.auto-archs && !matrix.use_qemu + if: runner.os == 'Windows' && inputs.auto && !contains(matrix.qemu_arch, matrix.arch) uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 with: arch: ${{ matrix.arch }} - name: Set up QEMU uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - if: runner.os == 'Linux' && github.event.inputs.extral-archs && matrix.use_qemu + if: runner.os == 'Linux' && inputs.extra && contains(matrix.qemu_arch, matrix.arch) - name: Build wheels if: > - github.event.inputs.extral-archs && matrix.use_qemu || - github.event.inputs.auto-archs && !matrix.use_qemu + inputs.auto && !contains(matrix.qemu_arch, matrix.arch) || + inputs.extra && contains(matrix.qemu_arch, matrix.arch) uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0 env: CIBW_ARCHS: ${{ matrix.arch }} @@ -59,9 +59,9 @@ jobs: - name: Upload wheels if: > - github.event.inputs.extral-archs && matrix.use_qemu || - github.event.inputs.auto-archs && !matrix.use_qemu + inputs.auto && !contains(matrix.qemu_arch, matrix.arch) || + inputs.extra && contains(matrix.qemu_arch, matrix.arch) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 with: - name: cibw-${{ matrix.build }}-${{ matrix.arch }}-${{ matrix.os }} + name: cibw-${{ matrix.os }}-${{ matrix.build }}-${{ matrix.arch }} path: wheelhouse/*.whl diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 2c5ef38..f4644e3 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -111,7 +111,7 @@ metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" sdist.include = ["src/{{ module_name }}/_version.py"] cmake.args = [ "-DBUILD_TESTING=OFF", - "-DCMAKE_BUILD_TYPE=ReWithDebInfo", + "-DCMAKE_BUILD_TYPE=Release", "-DVCPKG_INSTALL_REPORT_FAILURE=ON", "-DVCPKG_INSTALL_OPTIONS=--allow-unsupported", "-DCMAKE_TOOLCHAIN_FILE=cmake/vcpkg/vcpkg.toolchain.cmake", diff --git a/template/vcpkg.json.jinja b/template/vcpkg.json.jinja index 61dff56..89af02a 100644 --- a/template/vcpkg.json.jinja +++ b/template/vcpkg.json.jinja @@ -41,7 +41,7 @@ [%- endif %] { "name": "cmake-modules", - "version": "1.6.8" + "version": "1.6.11" } [%- if compiled == true %], { @@ -54,7 +54,7 @@ "registries": [ { "kind": "git", - "baseline": "a1d862fc6df3883df4516ccdd0c204d14cf4dc64", + "baseline": "09ae1472980f5e2132654900bb48061444b1cea5", "repository": "https://github.com/msclock/cmake-registry", "packages": [ [%- if use_conan == true %] diff --git a/vcpkg.json b/vcpkg.json index 45ca77d..06f0f67 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -16,7 +16,7 @@ }, { "name": "cmake-modules", - "version": "1.6.8" + "version": "1.6.11" }, { "name": "robotology-cmake-ycm", @@ -27,7 +27,7 @@ "registries": [ { "kind": "git", - "baseline": "a1d862fc6df3883df4516ccdd0c204d14cf4dc64", + "baseline": "09ae1472980f5e2132654900bb48061444b1cea5", "repository": "https://github.com/msclock/cmake-registry", "packages": [ "cmake-modules",