diff --git a/.github/actions/setup-test-environment/action.yml b/.github/actions/setup-test-environment/action.yml index ca482ab82..5746ffd42 100644 --- a/.github/actions/setup-test-environment/action.yml +++ b/.github/actions/setup-test-environment/action.yml @@ -46,6 +46,7 @@ runs: run: | pip install "ruff >= 0.7.0, < 0.8.0" pip install pytest-github-actions-annotate-failures + pip install "twine == 5.1.1" # Please keep in sync with https://github.com/pypa/gh-action-pypi-publish/ - name: Install uv uses: astral-sh/setup-uv@v3 diff --git a/.github/workflows/release_python.yml b/.github/workflows/release_python.yml index ba9e7bf92..b129cdef2 100644 --- a/.github/workflows/release_python.yml +++ b/.github/workflows/release_python.yml @@ -4,6 +4,8 @@ on: push: tags: - python-* + branches: + - main workflow_dispatch: jobs: @@ -114,11 +116,40 @@ jobs: path: ./dist/ retention-days: 30 + check-wheel: + runs-on: ubuntu-latest + needs: [linux, macos, windows, python-mip-adapter, pyscipopt-adapter] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Test Environment + uses: ./.github/actions/setup-test-environment + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: dist + pattern: "*" + merge-multiple: true + + - name: Check wheel + run: twine check --strict dist/* + publish: + if: startsWith(github.ref, 'refs/tags/python-') runs-on: ubuntu-latest permissions: id-token: write - needs: [linux, macos, windows, python-mip-adapter, pyscipopt-adapter] + needs: + [ + linux, + macos, + windows, + python-mip-adapter, + pyscipopt-adapter, + check-wheel, + ] steps: - name: Download artifacts uses: actions/download-artifact@v4 diff --git a/python/ommx/pyproject.toml b/python/ommx/pyproject.toml index d66055beb..4d7715c8b 100644 --- a/python/ommx/pyproject.toml +++ b/python/ommx/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=1.5,<2.0"] +requires = ["maturin == 1.7.5"] build-backend = "maturin" [project] @@ -7,7 +7,7 @@ name = "ommx" version = "1.4.4" description = "Open Mathematical prograMming eXchange (OMMX)" -authors = [{ name="Jij Inc.", email="info@j-ij.com" }] +authors = [{ name = "Jij Inc.", email = "info@j-ij.com" }] readme = "README.md" classifiers = [ @@ -61,4 +61,4 @@ module-name = "ommx._ommx_rust" features = ["pyo3/extension-module"] [tool.ruff.lint] -per-file-ignores = {"*_pb2.py" = ["ALL"]} +per-file-ignores = { "*_pb2.py" = ["ALL"] }