From 312390fc40b3c17b1c3751030c7370db3da6937f Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Mon, 11 Nov 2024 16:54:00 -0800 Subject: [PATCH] update publish flow --- .github/workflows/publish.yml | 46 ++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 301b2b0..ca8b25b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true jobs: - publish-python: + build-wheels: strategy: matrix: os: [ubuntu-latest, macos-latest] @@ -56,10 +56,8 @@ jobs: CIBW_ENVIRONMENT: | PATH="/usr/local/bin:$HOME/.cargo/bin:$PATH" CARGO_NET_GIT_FETCH_WITH_CLI=true - CIBW_BUILD_COMMAND: | - python -m pip install build - python -m build --sdist - run: cibuildwheel --output-dir dist + run: | + cibuildwheel --output-dir dist - name: Upload wheel artifacts uses: actions/upload-artifact@v3 @@ -69,8 +67,44 @@ jobs: dist/*.whl dist/*.tar.gz + build-source-dist: + name: Build and publish Python package (source distribution) + timeout-minutes: 10 + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install build + shell: bash + + - name: Build source distribution + run: | + python -m build --sdist --outdir dist + + - name: Upload source distribution + uses: actions/upload-artifact@v3 + with: + name: source-dist + path: | + dist/*.tar.gz + publish-wheels: - needs: publish-python + needs: [build-wheels, build-source-dist] name: Publish Python wheels timeout-minutes: 10 runs-on: ubuntu-latest