Skip to content

Commit 1bc9b02

Browse files
committed
[CI] fix pip page
1 parent af26297 commit 1bc9b02

File tree

2 files changed

+41
-14
lines changed

2 files changed

+41
-14
lines changed

.github/workflows/clean_releases.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,17 @@ jobs:
3131
3232
pip install PyGithub
3333
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python scripts/clean_gh_releases.py
34+
35+
call-deploy-pip-page:
36+
37+
if: (github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'workflow_dispatch'
38+
39+
needs: [delete_releases]
40+
41+
permissions:
42+
contents: read
43+
id-token: write
44+
pages: write
45+
46+
uses: ./.github/workflows/deploy_pip_page.yml
47+
secrets: inherit # pass all secrets

.github/workflows/deploy_pip_page.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616

1717
concurrency:
1818
group: "pages"
19-
cancel-in-progress: false
19+
cancel-in-progress: true
2020

2121
jobs:
2222
deploy:
@@ -51,23 +51,43 @@ jobs:
5151
with:
5252
python-version: '3.12'
5353

54-
- name: Fetch latest WASM wheel
54+
- name: Pip download latest WASM wheel
55+
if: ${{ !inputs.workflow_call }}
5556
run: |
57+
5658
pip download mlir-python-bindings --plat pyodide_2024_0_wasm32 --no-deps --python-version 3.12 -f https://llvm.github.io/eudsl
57-
echo "MLIR_PYTHON_WHEEL_NAME=$(ls mlir_python_bindings*)" >> $GITHUB_ENV
59+
60+
- name: Download latest WASM wheel
61+
if: ${{ inputs.workflow_call }}
62+
uses: dawidd6/action-download-artifact@v11
63+
with:
64+
name: mlir_python_bindings_ubuntu_wasm32_artifact
65+
path: "./"
66+
run_id: ${{ inputs.workflow_caller_run_id }}
67+
68+
- name: Get eudsl-python-extras
69+
run: |
70+
5871
pip wheel eudsl-python-extras -f https://llvm.github.io/eudsl --no-deps -w .
59-
echo "EUDSL_PYTHON_EXTRAS_WHEEL_NAME=$(ls eudsl_python_extras*)" >> $GITHUB_ENV
6072
6173
- name: Create WASM console page
6274
run: |
75+
6376
mkdir -p page/console
6477
78+
export MLIR_PYTHON_WHEEL_NAME="$(ls mlir_python_bindings*)"
79+
export EUDSL_PYTHON_EXTRAS_WHEEL_NAME="$(ls eudsl_python_extras*)"
80+
6581
cp pages/console/index.html page/console/index.html
6682
cp $MLIR_PYTHON_WHEEL_NAME page/console/mlir_python_bindings-0.0.1-cp312-cp312-pyodide_2024_0_wasm32.whl
6783
cp $EUDSL_PYTHON_EXTRAS_WHEEL_NAME page/console/eudsl_python_extras-0.0.1-py3-none-any.whl
84+
85+
echo "MLIR_PYTHON_WHEEL_NAME=$MLIR_PYTHON_WHEEL_NAME" >> $GITHUB_ENV
86+
echo "EUDSL_PYTHON_EXTRAS_WHEEL_NAME=$EUDSL_PYTHON_EXTRAS_WHEEL_NAME" >> $GITHUB_ENV
6887
6988
- name: Create WASM jupyterlite page
7089
run: |
90+
7191
mkdir -p page/jupyter
7292
7393
python -m pip install -r pages/jupyter/requirements.txt
@@ -77,20 +97,13 @@ jobs:
7797
--piplite-wheels $MLIR_PYTHON_WHEEL_NAME \
7898
--piplite-wheels $EUDSL_PYTHON_EXTRAS_WHEEL_NAME
7999
80-
- name: Show directory structure
81-
run: |
82-
tree page
83-
84-
- uses: geekyeggo/delete-artifact@v5
85-
with:
86-
name: github-pages
87-
failOnError: false
88-
89100
- name: Upload artifact
101+
if: (!cancelled())
90102
uses: actions/upload-pages-artifact@v3
91103
with:
92104
path: page
93-
105+
94106
- name: Deploy to GitHub Pages
107+
if: (!cancelled())
95108
id: deployment
96109
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)