-
Notifications
You must be signed in to change notification settings - Fork 9
120 lines (95 loc) · 3.64 KB
/
deploy_pip_page.yml
File metadata and controls
120 lines (95 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Deploy static content to Pages
on:
push:
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"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: false
- name: Download pip links
shell: bash
run: |
wget https://github.com/llvm/eudsl/releases/expanded_assets/mlir-python-bindings
wget https://github.com/llvm/eudsl/releases/expanded_assets/eudsl
wget https://github.com/llvm/eudsl/releases/expanded_assets/llvm
wget https://github.com/llvm/eudsl/releases/expanded_assets/eudsl-python-extras
cat mlir-python-bindings eudsl llvm eudsl-python-extras > index.html
sed -i.bak 's/\/llvm\/eudsl/https:\/\/github.com\/llvm\/eudsl/g' index.html
mkdir -p page && mv index.html page
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- 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
- 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 .
- 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
jupyter lite build \
--contents pages/jupyter/contents \
--output-dir page/jupyter \
--piplite-wheels $MLIR_PYTHON_WHEEL_NAME \
--piplite-wheels $EUDSL_PYTHON_EXTRAS_WHEEL_NAME
- 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