From f49cfe4db2867a36897853219eef9aa7020a8245 Mon Sep 17 00:00:00 2001 From: Duc Trung LE Date: Tue, 5 Mar 2024 15:13:45 +0100 Subject: [PATCH] Update build script --- .github/workflows/build.yml | 62 ++++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 68 ------------------------------------ examples/test.jcad | 4 +-- lite/build-environment.yml | 8 ----- 4 files changed, 63 insertions(+), 79 deletions(-) delete mode 100644 .github/workflows/deploy.yml delete mode 100644 lite/build-environment.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50f58470..741aefc5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -195,3 +195,65 @@ jobs: - uses: actions/checkout@v3 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 + + build-lite: + name: Build JupyterLite + needs: integration-tests + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Conda environment with Micromamba + uses: mamba-org/setup-micromamba@v1 + with: + micromamba-version: '1.5.5-0' + environment-name: build-env + create-args: >- + python=3.10 + pip + jupyterlite-core>=0.2.0,<0.3.0 + jupyterlite-xeus>=0.1.2,<0.2 + + - name: Download extension package + uses: actions/download-artifact@v3 + with: + name: extension-artifacts + + - name: Install the extension + shell: bash -l {0} + run: | + set -eux + cp ./jupytercad_core/dist/jupytercad*.whl ./jupytercad_lab/dist/jupytercad*.whl ./jupytercad_app/dist/jupytercad*.whl . + python -m pip install jupytercad*.whl + + - name: Build the lite site + shell: bash -l {0} + working-directory: lite + run: | + set -eux + mkdir -p content && cp ../examples/test.jcad ./content + jupyter lite build --contents content --output-dir dist + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./lite/dist + + deploy: + needs: build-lite + if: github.ref == 'refs/heads/main' + 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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 4aa53f63..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Build JupyterLite and Deploy - -on: - workflow_run: - workflows: ['Build'] - types: - - completed - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Install mamba - uses: mamba-org/provision-with-micromamba@main - with: - micromamba-version: '1.4.2' - environment-file: 'lite/build-environment.yml' - - - name: Download extension package - uses: dawidd6/action-download-artifact@v2 - with: - workflow: 'build.yml' - workflow_conclusion: 'success' - name: extension-artifacts - - - name: Install the extension - shell: bash -l {0} - run: | - cp ./jupytercad_core/dist/jupytercad*.whl ./jupytercad_lab/dist/jupytercad*.whl ./jupytercad_app/dist/jupytercad*.whl . - python -m pip install jupytercad*.whl - - - name: Build the lite site - shell: bash -l {0} - working-directory: lite - run: | - set -eux - mkdir -p content && cp ../examples/test.jcad ./content - jupyter lite build --contents content --output-dir dist - - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: ./lite/dist - - deploy: - needs: build - if: github.ref == 'refs/heads/main' - 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 diff --git a/examples/test.jcad b/examples/test.jcad index b3dfd00a..aa4cf872 100644 --- a/examples/test.jcad +++ b/examples/test.jcad @@ -97,9 +97,7 @@ } } ], - "options": { - "foo": 1 - }, + "options": {}, "metadata": {}, "outputs": {} } \ No newline at end of file diff --git a/lite/build-environment.yml b/lite/build-environment.yml deleted file mode 100644 index 02de55bf..00000000 --- a/lite/build-environment.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: build-env -channels: - - conda-forge -dependencies: - - python - - pip - - jupyterlite-core >=0.2.0,<0.3.0 - - jupyterlite-xeus>=0.1.2,<0.2