Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions .github/workflows/clean_releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,17 @@ jobs:

pip install PyGithub
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python scripts/clean_gh_releases.py

call-deploy-pip-page:

if: (github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'workflow_dispatch'

needs: [delete_releases]

permissions:
contents: read
id-token: write
pages: write

uses: ./.github/workflows/deploy_pip_page.yml
secrets: inherit # pass all secrets
47 changes: 33 additions & 14 deletions .github/workflows/deploy_pip_page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
branches: ["main"]
workflow_dispatch:
workflow_call:
inputs:
workflow_call:
description: 'To distinguish workflow_call from regular push'
type: boolean
required: false
default: true
pull_request:
paths:
- ".github/workflows/deploy_pip_page.yml"
Expand All @@ -16,7 +22,7 @@ permissions:

concurrency:
group: "pages"
cancel-in-progress: false
cancel-in-progress: true

jobs:
deploy:
Expand Down Expand Up @@ -51,23 +57,43 @@ jobs:
with:
python-version: '3.12'

- name: Fetch latest WASM wheel
- name: Pip download latest WASM wheel
if: ${{ !inputs.workflow_call }}
run: |

pip download mlir-python-bindings --plat pyodide_2024_0_wasm32 --no-deps --python-version 3.12 -f https://llvm.github.io/eudsl
echo "MLIR_PYTHON_WHEEL_NAME=$(ls mlir_python_bindings*)" >> $GITHUB_ENV

- name: Download latest WASM wheel
if: ${{ inputs.workflow_call }}
uses: dawidd6/action-download-artifact@v11
with:
name: mlir_python_bindings_ubuntu_wasm32_artifact
path: "./"
run_id: ${{ inputs.workflow_caller_run_id }}

- name: Get eudsl-python-extras
run: |

pip wheel eudsl-python-extras -f https://llvm.github.io/eudsl --no-deps -w .
echo "EUDSL_PYTHON_EXTRAS_WHEEL_NAME=$(ls eudsl_python_extras*)" >> $GITHUB_ENV

- name: Create WASM console page
run: |

mkdir -p page/console

export MLIR_PYTHON_WHEEL_NAME="$(ls mlir_python_bindings*)"
export EUDSL_PYTHON_EXTRAS_WHEEL_NAME="$(ls eudsl_python_extras*)"

cp pages/console/index.html page/console/index.html
cp $MLIR_PYTHON_WHEEL_NAME page/console/mlir_python_bindings-0.0.1-cp312-cp312-pyodide_2024_0_wasm32.whl
cp $EUDSL_PYTHON_EXTRAS_WHEEL_NAME page/console/eudsl_python_extras-0.0.1-py3-none-any.whl

echo "MLIR_PYTHON_WHEEL_NAME=$MLIR_PYTHON_WHEEL_NAME" >> $GITHUB_ENV
echo "EUDSL_PYTHON_EXTRAS_WHEEL_NAME=$EUDSL_PYTHON_EXTRAS_WHEEL_NAME" >> $GITHUB_ENV

- name: Create WASM jupyterlite page
run: |

mkdir -p page/jupyter

python -m pip install -r pages/jupyter/requirements.txt
Expand All @@ -77,20 +103,13 @@ jobs:
--piplite-wheels $MLIR_PYTHON_WHEEL_NAME \
--piplite-wheels $EUDSL_PYTHON_EXTRAS_WHEEL_NAME

- name: Show directory structure
run: |
tree page

- uses: geekyeggo/delete-artifact@v5
with:
name: github-pages
failOnError: false

- name: Upload artifact
if: (!cancelled())
uses: actions/upload-pages-artifact@v3
with:
path: page

- name: Deploy to GitHub Pages
if: (!cancelled())
id: deployment
uses: actions/deploy-pages@v4
Loading