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

Build for pyodide, take 2 #2

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Prev Previous commit
Update
  • Loading branch information
wch committed May 2, 2023
commit a113859b0fa8fe7d0cad4fe38abacc7cc81cdeca
69 changes: 18 additions & 51 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,23 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT
id: branch_name

- name: Print info
shell: bash
run: |
echo "github.ref: ${{ github.ref }}"
echo "github.event_name: ${{ github.event_name }}"
echo "github.head_ref: ${{ github.head_ref }}"
echo "steps.branch_name.outputs.branch: ${{ steps.branch_name.outputs.branch }}"
- uses: actions/setup-python@v4
with:
python-version: 3.10.11
- run: |
pip install pyodide-build==0.22.1
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
- name: Install rustc toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
target: wasm32-unknown-emscripten
- uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
actions-cache-folder: 'emsdk-cache'
- run: pyodide build

- name: Push to pyodide-wheel branch
if: github.head_ref == 'pyodide-build' && github.event_name == 'pull_request'
Expand All @@ -116,45 +121,7 @@ jobs:
git config user.email "[email protected]"
export SHA_SHORT=$(git rev-parse --short HEAD)
git checkout -B pyodide-wheel
pwd
echo "foo" > foo.txt
git add foo.txt
git add -f dist
git commit -m"Build pyodide wheel for $SHA_SHORT"
git log -n 4 --pretty=oneline --simplify-by-decoration
git push -f origin pyodide-wheel:pyodide-wheel


# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: 3.10.11
# - run: |
# pip install pyodide-build==0.22.1
# echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
# - name: Install rustc toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: nightly
# default: true
# target: wasm32-unknown-emscripten
# - uses: mymindstorm/setup-emsdk@v12
# with:
# version: ${{ env.EMSCRIPTEN_VERSION }}
# actions-cache-folder: 'emsdk-cache'
# - run: pyodide build

# # =====================================================
# # Commit wheel file to pyodide-wheel branch
# # =====================================================
# - name: Push to pyodide-wheel branch
# # if: github.ref == 'refs/heads/pyodide-build' && github.event_name == 'pull_request'
# shell: bash
# run: |
# git config user.name "GitHub Actions"
# git config user.email "[email protected]"
# export SHA_SHORT=$(git rev-parse --short HEAD)
# git checkout -B pyodide-wheel
# git add -f dist
# git commit -m"Build pyodide wheel for $SHA_SHORT"
# git log -n 4 --pretty=oneline --simplify-by-decoration
# git push -f origin pyodide-wheel:pyodide-wheel
Loading