Skip to content

Commit

Permalink
feat: prepare python release
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Sep 23, 2024
1 parent 4ffc20b commit a130a6a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 179 deletions.
206 changes: 29 additions & 177 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,12 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: ${{ matrix.platform.arch }}
- name: "Build wheels (rustls-tls)"
- name: "Build wheels"
uses: PyO3/maturin-action@v1
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
with:
working-directory: py-rattler
target: ${{ matrix.platform.target }}
args: --release --out dist --no-default-features --features rustls-tls
- name: "Build wheels (native-tls)"
uses: PyO3/maturin-action@v1
if: ${{ startsWith(matrix.platform.target, 'aarch64') }}
with:
working-directory: py-rattler
target: ${{ matrix.platform.target }}
args: --release --out dist --no-default-features --features native-tls,vendored-openssl
- name: "Test wheel"
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
shell: bash
Expand All @@ -105,29 +97,37 @@ jobs:
path: py-rattler/dist

linux:
runs-on: ubuntu-latest
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.platform.runner }}
name: Build ${{ matrix.platform.target }}
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- i686-unknown-linux-gnu
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
with:
ref: ${{ inputs.sha }}
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
- name: "Build wheels"
uses: PyO3/maturin-action@v1
with:
working-directory: py-rattler
target: ${{ matrix.target }}
target: ${{ matrix.platform.target }}
manylinux: auto
args: --release --out dist --no-default-features --features rustls-tls
args: --release --out dist --zig --no-default-features --features rustls-tls
- name: "Test wheel"
if: ${{ startsWith(matrix.target, 'x86_64') }}
run: |
Expand All @@ -139,67 +139,20 @@ jobs:
name: linux-wheels-${{ matrix.target }}
path: py-rattler/dist

linux-cross:
runs-on: ubuntu-latest
name: Build ${{ matrix.platform.target }}
strategy:
fail-fast: false
matrix:
platform:
- target: aarch64-unknown-linux-gnu
arch: aarch64
- target: armv7-unknown-linux-gnueabihf
arch: armv7

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.sha }}
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "Build wheels"
uses: PyO3/maturin-action@v1
with:
working-directory: py-rattler
target: ${{ matrix.platform.target }}
manylinux: '2_28'
docker-options: ${{ matrix.platform.maturin_docker_options }}
args: --release --out dist --no-default-features --features rustls-tls
- uses: uraimo/run-on-arch-action@v2
if: matrix.platform.arch != 'ppc64'
name: Test wheel
with:
arch: ${{ matrix.platform.arch }}
distro: ubuntu20.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip
pip3 install -U pip
run: |
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links py-rattler/dist/ --force-reinstall
python3 -c "import rattler; print(rattler.__version__)"
- name: "Upload wheels"
uses: actions/upload-artifact@v4
with:
name: linux-wheels-${{ matrix.platform.target }}
path: py-rattler/dist

linux-cross-native-tls:
runs-on: ubuntu-latest
name: Build ${{ matrix.platform.target }}
musllinux:
name: Build musl ${{ matrix.platform.target }}
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
# - target: s390x-unknown-linux-gnu
# arch: s390x
- target: powerpc64le-unknown-linux-gnu
arch: ppc64le
- target: powerpc64-unknown-linux-gnu
arch: ppc64

- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -208,66 +161,12 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "Build wheels"
uses: PyO3/maturin-action@v1
with:
working-directory: py-rattler
target: ${{ matrix.platform.target }}
manylinux: auto
docker-options: ${{ matrix.platform.maturin_docker_options }}
args: --release --out dist --no-default-features --features native-tls,vendored-openssl
- uses: uraimo/run-on-arch-action@v2
if: matrix.platform.arch != 'ppc64'
name: Test wheel
with:
arch: ${{ matrix.platform.arch }}
distro: ubuntu20.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip
pip3 install -U pip
run: |
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links py-rattler/dist/ --force-reinstall
python3 -c "import rattler; print(rattler.__version__)"
- name: "Upload wheels"
uses: actions/upload-artifact@v4
with:
name: linux-wheels-${{ matrix.platform.target }}
path: py-rattler/dist

musllinux:
runs-on: ubuntu-latest
name: Build ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-musl
- i686-unknown-linux-musl
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.sha }}
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
- name: "Build wheels (rustls-tls)"
if: matrix.target == 'x86_64-unknown-linux-musl'
uses: PyO3/maturin-action@v1
with:
working-directory: py-rattler
target: ${{ matrix.target }}
manylinux: musllinux_1_2
args: --release --out dist --no-default-features --features rustls-tls
- name: "Build wheels (native-tls)"
if: matrix.target != 'x86_64-unknown-linux-musl'
uses: PyO3/maturin-action@v1
with:
working-directory: py-rattler
target: ${{ matrix.target }}
manylinux: musllinux_1_2
args: --release --out dist --no-default-features --features native-tls,vendored-openssl
- name: "Test wheel"
if: matrix.target == 'x86_64-unknown-linux-musl'
uses: addnab/docker-run-action@v3
Expand All @@ -284,50 +183,6 @@ jobs:
name: linux-wheels-${{ matrix.target }}
path: py-rattler/dist

musllinux-cross:
runs-on: ubuntu-latest
name: Build ${{ matrix.platform.target }}
strategy:
fail-fast: false
matrix:
platform:
- target: aarch64-unknown-linux-musl
arch: aarch64
- target: armv7-unknown-linux-musleabihf
arch: armv7

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.sha }}
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "Build wheels"
uses: PyO3/maturin-action@v1
with:
working-directory: py-rattler
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_2
args: --release --out dist --no-default-features --features rustls-tls
docker-options: ${{ matrix.platform.maturin_docker_options }}
- uses: uraimo/run-on-arch-action@v2
name: Test wheel
with:
arch: ${{ matrix.platform.arch }}
distro: alpine_latest
githubToken: ${{ github.token }}
install: |
apk add py3-pip
run: |
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links py-rattler/dist/ --force-reinstall --break-system-packages
python3 -c "import rattler; print(rattler.__version__)"
- name: "Upload wheels"
uses: actions/upload-artifact@v4
with:
name: linux-wheels-${{ matrix.platform.target }}
path: py-rattler/dist

macos-x86_64:
runs-on: macos-13 # x86_64 runner
name: Build x86_64-macos
Expand Down Expand Up @@ -422,10 +277,7 @@ jobs:
- macos-x86_64
- windows
- linux
- linux-cross
- linux-cross-native-tls
- musllinux
- musllinux-cross
- validate-tag
# If you don't set an input tag, it's a dry run (no uploads).
if: ${{ inputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion py-rattler/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion py-rattler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "py-rattler"
version = "0.6.3"
version = "0.7.0"
edition = "2021"
license = "BSD-3-Clause"
publish = false
Expand Down

0 comments on commit a130a6a

Please sign in to comment.