diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37ab699..9b63c29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,8 +11,9 @@ concurrency: cancel-in-progress: true jobs: - build: + build_jupyter-chat: runs-on: ubuntu-latest + name: Build jupyter_chat steps: - name: Checkout @@ -24,48 +25,48 @@ jobs: - name: Install dependencies run: python -m pip install -U "jupyterlab>=4.0.0,<5" - - name: Lint the extension + - name: Lint the packages run: | set -eux jlpm jlpm run lint:check + - name: Build the core package + run: jlpm build:core + - name: Test the packages run: | set -eux jlpm run test - - name: Build packages - run: jlpm build - - - name: Package jupyterlab_ws_chat - working-directory: packages/jupyterlab-ws-chat - run: | - set -eux - pip install build - python -m build - pip uninstall -y "jupyterlab_ws_chat" jupyterlab + build_extensions: + runs-on: ubuntu-latest + needs: build_jupyter-chat + strategy: + matrix: + extension: [collaborative, websocket] + name: Build ${{ matrix.extension }} chat extension + env: + PACKAGE: fromJSON('["jupyterlab_ws_chat", "jupyterlab_${{ matrix.extension }}_chat"]')[matrix.extension == 'websocket'] + DIRECTORY: fromJSON('["packages/jupyterlab-ws-chat", "packages/jupyterlab-${{ matrix.extension }}-chat"]')[matrix.extension == 'websocket'] - - name: Upload jupyterlab_ws_chat packages - uses: actions/upload-artifact@v3 - with: - name: package-artifacts - path: packages/jupyterlab-ws-chat/dist/jupyterlab_ws_chat* - if-no-files-found: error + steps: + - name: Build package + run: jlpm build:${{ matrix.extension }} - - name: Package jupyterlab_collaborative_chat - working-directory: packages/jupyterlab-collaborative-chat + - name: Package ${{ env.PACKAGE }} + working-directory: ${{ env.DIRECTORY }} run: | set -eux pip install build python -m build - pip uninstall -y "jupyterlab_collaborative_chat" jupyterlab + pip uninstall -y "${{ env.PACKAGE }}" jupyterlab - - name: Upload jupyterlab_collaborative_chat packages + - name: Upload ${{ env.PACKAGE }} package uses: actions/upload-artifact@v3 with: name: package-artifacts - path: packages/jupyterlab-collaborative-chat/dist/jupyterlab_collaborative_chat* + path: ${{ env.DIRECTORY }}/dist/${{ env.PACKAGE }}* if-no-files-found: error check_links: