Skip to content

Commit

Permalink
Merge pull request #1777 from girder/girder-5-build-client-on-release
Browse files Browse the repository at this point in the history
Build plugin client code on release
  • Loading branch information
naglepuff authored Jan 23, 2025
2 parents 2a74a9b + 8346aa2 commit d9391e7
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 4 deletions.
58 changes: 54 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,11 @@ jobs:
- store_artifacts:
path: ~/wheels
check_release:
docker:
- image: cimg/python:3.10
executor: toxandnode
parameters:
node:
type: string
default: v20
steps:
- checkout
- run:
Expand All @@ -307,12 +310,37 @@ jobs:
- run:
name: Install python packages
command: pip install setuptools_scm twine
- run:
name: Use nvm
# see https://discuss.circleci.com/t/nvm-does-not-change-node-version-on-machine/28973/14
command: |
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- restore_cache:
name: Restore nvm cache
key: v1-nvm-cache-<< parameters.node >>
- run:
name: Switch node versions
command: |
. ~/.bashrc
nvm install << parameters.node >>
nvm alias default << parameters.node >>
NODE_DIR=$(dirname $(which node))
echo "export PATH=$NODE_DIR:\$PATH" >> $BASH_ENV
- run:
name: Check node versions
command: |
node --version
npm --version
- run:
name: Check release to PyPi
command: ./.circleci/release_pypi.sh check
release:
docker:
- image: cimg/python:3.10
executor: toxandnode
parameters:
node:
type: string
default: v20
steps:
- checkout
- run:
Expand All @@ -323,6 +351,28 @@ jobs:
- run:
name: Install python packages
command: pip install setuptools_scm twine
- run:
name: Use nvm
# see https://discuss.circleci.com/t/nvm-does-not-change-node-version-on-machine/28973/14
command: |
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- restore_cache:
name: Restore nvm cache
key: v1-nvm-cache-<< parameters.node >>
- run:
name: Switch node versions
command: |
. ~/.bashrc
nvm install << parameters.node >>
nvm alias default << parameters.node >>
NODE_DIR=$(dirname $(which node))
echo "export PATH=$NODE_DIR:\$PATH" >> $BASH_ENV
- run:
name: Check node versions
command: |
node --version
npm --version
- run:
name: Release to PyPi
command: ./.circleci/release_pypi.sh upload
Expand Down
11 changes: 11 additions & 0 deletions .circleci/release_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@ twine ${1:-check} $( [[ "${1:-check}" == "upload" ]] && printf %s '--verbose' )
cd "$ROOTPATH/girder"
cp "$ROOTPATH/README.rst" .
cp "$ROOTPATH/LICENSE" .
# Build the client plugin code
pushd "$ROOTPATH/girder/girder_large_image/web_client/"
npm ci
npm run build
popd
python setup.py sdist
pip wheel . --no-deps -w dist
twine ${1:-check} $( [[ "${1:-check}" == "upload" ]] && printf %s '--verbose' ) dist/*
cd "$ROOTPATH/girder_annotation"
cp "$ROOTPATH/README.rst" .
cp "$ROOTPATH/LICENSE" .
# Build the client plugin code
pushd "$ROOTPATH/girder_annotation/girder_large_image_annotation/web_client/"
npm ci
npm run build
popd
python setup.py sdist
pip wheel . --no-deps -w dist
twine ${1:-check} $( [[ "${1:-check}" == "upload" ]] && printf %s '--verbose' ) dist/*
Expand Down Expand Up @@ -49,6 +59,7 @@ twine ${1:-check} $( [[ "${1:-check}" == "upload" ]] && printf %s '--verbose' )
cd "$ROOTPATH/sources/dicom"
cp "$ROOTPATH/README.rst" .
cp "$ROOTPATH/LICENSE" .
# TODO build DICOMweb plugin client code when converted
python setup.py sdist
pip wheel . --no-deps -w dist
twine ${1:-check} $( [[ "${1:-check}" == "upload" ]] && printf %s '--verbose' ) dist/*
Expand Down
2 changes: 2 additions & 0 deletions girder/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prune girder_large_image/web_client
recursive-include girder_large_image/web_client/dist/ *
2 changes: 2 additions & 0 deletions girder_annotation/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prune girder_large_image_annotation/web_client
recursive-include girder_large_image_annotation/web_client/dist/ *

0 comments on commit d9391e7

Please sign in to comment.