Skip to content

Commit

Permalink
Avoid using variables in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Apr 8, 2024
1 parent 1fe6e55 commit 06ec916
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,10 @@ jobs:
needs: build_jupyter-chat
strategy:
matrix:
extension: [collaborative, websocket]
extension: [collaborative, ws]
name: Build ${{ matrix.extension }} chat extension

steps:
- name: Create variables
run: |
[ "${{ matrix.extension }}" = "websocket" ] && echo "PACKAGE=jupyterlab_ws_chat" || echo "PACKAGE=jupyterlab_${{ matrix.extension }}_chat" >> $GITHUB_ENV
[ "${{ matrix.extension }}" = "websocket" ] && echo "DIRECTORY=packages/jupyterlab-ws-chat" || echo "DIRECTORY=packages/jupyterlab-${{ matrix.extension }}-chat" >> $GITHUB_ENV
echo $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3

Expand All @@ -68,19 +62,18 @@ jobs:
jlpm install
jlpm build:${{ matrix.extension }}
- name: Package $PACKAGE
working-directory: $DIRECTORY
- name: Package extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "$PACKAGE" jupyterlab
pip install build packages/jupyterlab-${{ matrix.extension }}-chat
python -m build jupyterlab-${{ matrix.extension }}-chat
pip uninstall -y "jupyterlab_${{ matrix.extension }}_chat" jupyterlab
- name: Upload $PACKAGE package
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: package-artifacts
path: $DIRECTORY/dist/$PACKAGE*
path: packages/jupyterlab-${{ matrix.extension }}-chat/dist/jupyterlab_${{ matrix.extension }}_chat*
if-no-files-found: error

check_links:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"build": "lerna run build --stream",
"build:core": "lerna run build --stream --scope \"chat-jupyter\"",
"build:collaborative": "lerna run build --scope=jupyterlab-collaborative-chat --include-filtered-dependencies",
"build:websocket": "lerna run build --scope=jupyterlab-ws-chat --include-filtered-dependencies",
"build:ws": "lerna run build --scope=jupyterlab-ws-chat --include-filtered-dependencies",
"build:prod": "lerna run build:prod --stream",
"clean": "lerna run clean",
"clean:all": "lerna run clean:all",
Expand Down
4 changes: 1 addition & 3 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

EXTENSION=$1

[ "${EXTENSION}" = "websocket" ] && PACKAGE="jupyterlab-ws-chat" || PACKAGE="jupyterlab-${EXTENSION}-chat"


# install core packages
pip install jupyterlab~=4.0
jlpm install
Expand All @@ -19,6 +16,7 @@ if [ -z "${EXTENSION}" ]; then
# install websocket chat extension
pip install -e packages/jupyterlab-ws-chat[test]
else
PACKAGE="jupyterlab-${EXTENSION}-chat"
jlpm build:${EXTENSION}
pip install -e packages/${PACKAGE}[test]
fi

0 comments on commit 06ec916

Please sign in to comment.