You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
riscemu/.github/workflows/jupyterlite.yml

99 lines
2.5 KiB
YAML

name: Deploy JupiterLite Page
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout RiscEmu
uses: actions/checkout@v3
with:
path: riscemu
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install jupyterlite[all] libarchive-c build pyodide-build
2 years ago
- name: Build RiscEmu source distribution
run: |
cd riscemu
python setup.py sdist
# Pyodide is cached, so cloned only if not present in the cache, otherwise
# just checked out to whatever desired version and partially rebuilt.
- name: Restore cached Pyodide tree
id: cache-pyodide
uses: actions/cache@v3
with:
path: pyodide
key: pyodide
2 years ago
- name: Clone pyodide if not cached
if: steps.cache-pyodide.outputs.cache-hit != 'true'
run: git clone https://github.com/pyodide/pyodide.git
# Clean the xDSL and FrozenList package folders, generate their skeletons
# and do the necessary updates before building.
- name: Build custom Pyodide distribution
run: |
2 years ago
cd pyodide
git fetch --all
git checkout 0.22.0a3
python -m pip install -r requirements.txt
sudo apt update && sudo apt install f2c
2 years ago
rm -rf packages/riscemu
pyodide skeleton pypi riscemu
2 years ago
PYODIDE_PACKAGES="riscemu" make
- name: Build the JupyterLite site
run: |
mkdir content
cp riscemu/docs/* content -r
cp riscemu/examples content -r
2 years ago
rm -rf pyodide/pyodide
mkdir pyodide/pyodide
mv pyodide/dist pyodide/pyodide/pyodide
2 years ago
python -m jupyter lite build --contents content --pyodide pyodide/pyodide
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./_output
deploy:
needs: build
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1