Skip to content

Commit

Permalink
Build wheels for emscripten target (#110)
Browse files Browse the repository at this point in the history
* Build wheels for emscripten target

* Only build emscripten wheels on push to main and on release

* Update ci.yml
  • Loading branch information
messense authored Jun 22, 2022
1 parent f486dd5 commit d01ac2c
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,53 @@ jobs:

- run: make rust-benchmark

build_wasm_emscripten:
name: build wasm emscripten
# only run on push to main and on release
if: "success() && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')"
needs: [test, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rust-src
target: wasm32-unknown-emscripten
override: true

- uses: mymindstorm/setup-emsdk@v11
with:
version: 3.1.13
actions-cache-folder: emsdk-cache

- name: set up python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: set package version
run: python .github/set_version.py
if: "startsWith(github.ref, 'refs/tags/')"

- name: Sync Cargo.lock
run: cargo update -p pydantic-core
if: "startsWith(github.ref, 'refs/tags/')"

- run: pip install -U --pre maturin

- name: build wheels
run: maturin build --release --target wasm32-unknown-emscripten --out dist -i 3.10

- run: ls -lh dist

- uses: actions/upload-artifact@v3
with:
name: wasm_wheels
path: dist

build:
name: build on ${{ matrix.platform || matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }})
# only run on push to main and on release
Expand Down

0 comments on commit d01ac2c

Please sign in to comment.