From f1a9669b80be707dcab6393d794b30e486a9771f Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 10 Apr 2024 11:30:18 +0200 Subject: [PATCH] no sitelib here --- .github/workflows/release.yml | 59 ++++++++++++++++++++++------------- pyproject.toml | 1 + 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bda33e7..65074a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,16 +14,15 @@ env: CMEEL_LOG_LEVEL: DEBUG jobs: - wheel: - name: "${{ matrix.build }} ${{ matrix.os }} ${{ matrix.arch }}" - runs-on: "${{ matrix.os }}" + linux: + name: "${{ matrix.image }} ${{ matrix.arch }}" + runs-on: "ubuntu-latest" strategy: matrix: - os: ["ubuntu-latest", "macos-latest"] + image: ["manylinux_2_28", "musllinux_1_1"] arch: ["x86_64", "aarch64"] - build: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"] exclude: - - os: "macos-latest" + - image: "musllinux_1_1" arch: "aarch64" steps: - uses: actions/checkout@v4 @@ -34,19 +33,29 @@ jobs: uses: docker/setup-qemu-action@v3 with: platforms: all - - run: pipx install cibuildwheel - - run: cibuildwheel --output-dir wh - env: - CIBW_BUILD: ${{ matrix.build }} - CIBW_ARCHS: ${{ matrix.arch }} - CIBW_SKIP: "*-musllinux_aarch64" - CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux_2_28_x86_64" - CIBW_MANYLINUX_AARCH64_IMAGE: "quay.io/pypa/manylinux_2_28_aarch64" - CIBW_REPAIR_WHEEL_COMMAND: "" - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL="DEBUG" + - run: pipx install cmeel + - run: cmeel docker -Ui "quay.io/pypa/${{ matrix.image }}_${{ matrix.arch }}" - uses: actions/upload-artifact@v4 with: - path: wh + name: "artifact-${{ matrix.image }}-${{ matrix.arch }}" + path: wh/cmeel_qpoases* + + macos: + name: "macos" + runs-on: "macos-latest" + steps: + - uses: actions/checkout@v4 + with: + submodules: 'true' + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + - run: python -m pip install -U pip + - run: python -m pip wheel -vw wh . + - uses: actions/upload-artifact@v4 + with: + name: "artifact-macos" + path: wh/cmeel_qpoases* sdist: runs-on: ubuntu-latest @@ -68,9 +77,13 @@ jobs: path: dist release: - needs: ["wheel", "sdist"] + needs: ["linux", "macos", "sdist"] if: ${{ startsWith(github.ref, 'refs/tags/v') }} runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + contents: write steps: - uses: actions/checkout@v4 with: @@ -81,10 +94,12 @@ jobs: git verify-tag --raw ${{ github.ref_name }} 2>&1 | grep -q 'VALIDSIG 9B1A79065D2F2B806C8A5A1C7D2ACDAF4653CF28' - uses: actions/download-artifact@v4 - - run: pipx install twine - - run: twine upload -u __token__ -p "${{ secrets.PYPI_TOKEN }}" artifact/cmeel_qpoases*.whl - - run: twine upload -u __token__ -p "${{ secrets.PYPI_TOKEN }}" artifact/cmeel_qpoases*.tar.gz || true + - run: mkdir dist && mv artifact*/* dist + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true - run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - run: gh release create -t "Release ${{ env.TAG}}" -n "$(awk '/## \[${{ env.TAG }}] - /{flag=1;next}/## \[/{flag=0}flag' CHANGELOG.md)" ${{ env.TAG }} artifact/cmeel_qpoases*.{whl,tar.gz} + - run: gh release create -t "Release ${{ env.TAG}}" -n "$(awk '/## \[${{ env.TAG }}] - /{flag=1;next}/## \[/{flag=0}flag' CHANGELOG.md)" ${{ env.TAG }} dist/cmeel_qpoases*.{whl,tar.gz} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 02f8b20..87701ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,7 @@ homepage = "https://github.com/cmake-wheel/cmeel-qpoases" [tool.cmeel] build-number = 1 configure-args = ["-DBUILD_SHARED_LIBS=ON"] +has-sitelib = false run-tests = false source = "qpOASES"