Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pyodide wheels #118

Merged
merged 5 commits into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 48 additions & 11 deletions .github/workflows/pyodide-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
name: Build pyodide wheels

on:
push:
tags:
- "py-v*"
# push:
# tags:
# - "py-v*"
workflow_dispatch:
inputs:
python:
description: "Python version"
required: true
default: "3.12"
type: choice
options:
- 3.12
- 3.13
- 3.14
- 3.15
pyodide:
description: "New Pyodide version to build for"
required: true
type: string

permissions:
contents: read
contents: write

jobs:
linux:
build:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -20,6 +35,9 @@ jobs:
- arro3-io
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python }}

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
Expand All @@ -28,12 +46,12 @@ jobs:

- uses: Swatinem/rust-cache@v2

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Python build dependencies
run: pip install maturin pyodide-build
run: pip install maturin pyodide-build==${{ inputs.pyodide }} wheel-filename

- name: Get emscripten version
run: |
echo PYODIDE_EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV

- name: Install emsdk & build wheels
run: |
Expand All @@ -44,11 +62,30 @@ jobs:
./emsdk activate ${PYODIDE_EMSCRIPTEN_VERSION}
source emsdk_env.sh
cd ..
RUSTUP_TOOLCHAIN=nightly maturin build --release -o dist --target wasm32-unknown-emscripten -i python${{ inputs.python }} --manifest-path ${{ matrix.module }}/Cargo.toml

RUSTUP_TOOLCHAIN=nightly maturin build --release -o dist --target wasm32-unknown-emscripten -i python3.11 --manifest-path ${{ matrix.module }}/Cargo.toml
- name: Get info from built wheel file
run: |
# get arrow version and wheel name and make metafile
ARRO3_WHEEL=$(basename dist/*.whl)
ARRO3_VERSION=$(wheel-filename ${ARRO3_WHEEL} | jq -r '.version')
ARROW_SHA256=$(sha256sum dist/*.whl | cut -d ' ' -f 1)
echo ARRO3_WHEEL=${ARRO3_WHEEL}>>$GITHUB_ENV
echo ARRO3_VERSION=${ARRO3_VERSION}>>$GITHUB_ENV

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-pyodide-${{ matrix.module }}
path: dist

- name: Create release
uses: ncipollo/release-action@v1
with:
tag: pyodide-v${{ inputs.pyodide }}-arro3-v${{ env.ARRO3_VERSION }}
name: Build of arro3 for pyodide v${{ inputs.pyodide}} and arro3 v${{ env.ARRO3_VERSION }}
artifacts: dist/*
replacesArtifacts: true
allowUpdates: true
updateOnlyUnreleased: true
prerelease: true