From 742022e48ab78495d815550f6ad06560b91277ce Mon Sep 17 00:00:00 2001 From: David Maxson <937812+scnerd@users.noreply.github.com> Date: Thu, 16 Jan 2025 16:30:18 -0800 Subject: [PATCH] CI/CD fix to add linux builds (#3) * [Temp] Simplify CI/CD, undo before merging * Remove (probably?) unneeded flag * Update and re-add linux to the build process * [Temp] Simplify CI/CD for testing * Revert "[Temp] Simplify CI/CD for testing" This reverts commit d931b04932ba5bc8953261ab17ec3340d269cfea. * Revert "[Temp] Simplify CI/CD, undo before merging" This reverts commit 83bad73aff1e7ef5bf238bf9fc9dcb9f4425f7d3. * Add linux builds to the release process * Added more linux architectures to build process --- .github/workflows/publish.yml | 76 ++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5e903fa..cc83ff8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,48 +45,52 @@ jobs: - name: Run tests run: uv run pytest tests -# linux: -# runs-on: ${{ matrix.platform.runner }} -# needs: [test] -# strategy: -# matrix: -# platform: -# - runner: ubuntu-latest -# target: x86_64 -# - runner: ubuntu-latest -# target: x86 -# - runner: ubuntu-latest -# target: aarch64 -# - runner: ubuntu-latest -# target: armv7 + linux: + runs-on: ${{ matrix.platform.runner }} + needs: [test] + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + - runner: ubuntu-latest + target: x86 + - runner: ubuntu-latest + target: aarch64 + - runner: ubuntu-latest + target: armv7 # - runner: ubuntu-latest # target: s390x # - runner: ubuntu-latest # target: ppc64le -# steps: -# - uses: actions/checkout@v4 -# - uses: actions/setup-python@v5 -# with: -# python-version: 3.x -# - run: pip install -e .[test] -# - name: Build wheels -# uses: PyO3/maturin-action@v1 -# with: -# target: ${{ matrix.platform.target }} -# args: --release --out dist --find-interpreter -# sccache: 'true' -# manylinux: auto -# - name: Upload wheels -# uses: actions/upload-artifact@v4 -# with: -# name: wheels-linux-${{ matrix.platform.target }} -# path: dist + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: Set up Python + run: uv python install + + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: 'true' + manylinux: auto + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-linux-${{ matrix.platform.target }} + path: dist musllinux: runs-on: ${{ matrix.platform.runner }} needs: [test] - env: - RUSTFLAGS: "-Ctarget-feature=-crt-static" strategy: matrix: platform: @@ -116,6 +120,7 @@ jobs: args: --release --out dist --find-interpreter sccache: 'true' manylinux: musllinux_1_2 + - name: Upload wheels uses: actions/upload-artifact@v4 with: @@ -215,8 +220,7 @@ jobs: name: Release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" -# needs: [linux, musllinux, windows, macos, sdist] - needs: [musllinux, windows, macos, sdist] + needs: [linux, musllinux, windows, macos, sdist] permissions: # IMPORTANT: this permission is mandatory for trusted publishing id-token: write