diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 27fd6a38..ca74a96e 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -21,6 +21,7 @@ permissions: jobs: build-wheels: name: Wheel - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }} + needs: build-sdist runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: fail-fast: false @@ -125,26 +126,27 @@ jobs: - name: Clean workspace uses: Chia-Network/actions/clean-workspace@main - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: - fetch-depth: 0 + name: packages-sdist + path: ./target/wheels/ + + - name: extract + shell: bash + run: | + mkdir extracted + cd extracted + ls -la ../target/wheels/ + tar -xvzf ../target/wheels/*.tar.gz + ls -la - uses: Chia-Network/actions/setup-python@main with: python-version: ${{ matrix.python.major-dot-minor }} - - name: Update pip - run: | - python -m pip install --upgrade pip - - name: Set up rust uses: dtolnay/rust-toolchain@stable - - name: Install dependencies - run: | - python -m pip install maturin - - name: Build MacOs with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'macos' env: @@ -152,7 +154,8 @@ jobs: run: | python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate - maturin build -i python --release -m wheel/Cargo.toml + pip install build + python -m build --wheel extracted/chia_rs-*/ - name: Build Linux with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' @@ -166,20 +169,27 @@ jobs: rustup target add ${{ matrix.python.by-arch[matrix.arch.matrix].rustup-target }} && \ python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ - pip install --upgrade pip && \ - pip install maturin && \ - CC=gcc maturin build --release --manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }} -m wheel/Cargo.toml \ + pip install build && \ + CC=gcc python -m build --wheel extracted/chia_rs-*/ \ ' - name: Build Windows with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'windows' + shell: bash env: CC: "clang" CFLAGS: "-D__BLST_PORTABLE__" run: | py -${{ matrix.python.major-dot-minor }} -m venv venv - . .\venv\Scripts\Activate.ps1 - maturin build -i python --release -m wheel/Cargo.toml + . venv/Scripts/activate + pip install build + python -m build --wheel extracted/chia_rs-*/ + + - name: copy the wheel + run: | + # TODO: maturin seems to entirely ignore python -m build --outdir + mkdir dist/ + cp extracted/*/target/wheels/*.whl dist/ - uses: Chia-Network/actions/create-venv@main id: create-venv @@ -192,7 +202,7 @@ jobs: shell: bash run: | TMP_DEST=$(mktemp -d) - pip download --no-index --no-deps --only-binary :all: --find-links target/wheels/ --dest "${TMP_DEST}" chia_rs + pip download --no-index --no-deps --only-binary :all: --find-links dist/ --dest "${TMP_DEST}" chia_rs echo ==== ls -l "${TMP_DEST}" echo ==== @@ -271,8 +281,8 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: packages-sdist-${{ matrix.os.name }}-${{ matrix.python.major-dot-minor }}-${{ matrix.arch.name }} - path: ./target/wheels/ + name: packages-sdist + path: ./target/wheels/*.tar.gz fmt: runs-on: ubuntu-latest