Skip to content

Commit

Permalink
Update pyodide wheels (#118)
Browse files Browse the repository at this point in the history
* Update pyodide wheels

* updates

* update pyodide wheels
  • Loading branch information
kylebarron authored Aug 14, 2024
1 parent 02c8483 commit fe711bb
Showing 1 changed file with 48 additions and 11 deletions.
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

0 comments on commit fe711bb

Please sign in to comment.