Skip to content

Commit

Permalink
Merge branch '1.0' into 1
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jul 26, 2022
2 parents bdf2e6d + 008fcd7 commit 244fdce
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,22 +180,45 @@ runs:
export NVM_DIR="$HOME/.nvm"
# this loads nvm into the current terminal
[[ -s "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh"
nvm install
nvm use
rm -rf client/dist
npm install -g yarn
yarn install --network-concurrency 1
ADMIN_NPM_VERSION=
if [[ -d vendor/silverstripe/admin ]]; then
cd vendor/silverstripe/admin
nvm install
nvm use
ADMIN_NPM_VERSION=$(npm -v)
npm install -g yarn
yarn install --network-concurrency 1
cd ../../..
fi
if [[ $(cat package.json | jq -r '.scripts.build') != 'null' ]]; then
nvm install
nvm use
if [[ $(npm -v) != $ADMIN_NPM_VERSION ]]; then
npm install -g yarn;
fi
yarn install --network-concurrency 1
if [[ $(cat package.json | jq -r '.scripts.build') != 'null' ]]; then
DIST_DIR=
if [[ -d client/dist ]]; then
DIST_DIR=client/dist
elif [[ -d dist ]]; then
DIST_DIR=dist
else
echo "No dist directory found"
exit 1
fi
echo "Deleting $DIST_DIR"
rm -rf $DIST_DIR
echo "Running yarn build"
yarn run build
echo "Running git diff"
git diff-files --quiet -w --relative=client
git diff --name-status --relative=client
# Add all files to ensure that any new files previously uncommitted are tracked
git add $DIST_DIR
GIT_DIFF=$(git diff --cached --name-status --relative=$DIST_DIR)
if [[ $GIT_DIFF != "" ]]; then
echo "git diff found modified files when it should not have:"
echo $GIT_DIFF
exit 1
fi
fi
if [[ $(cat package.json | jq -r '.scripts.test') != 'null' ]]; then
echo "Running yarn test"
Expand Down

0 comments on commit 244fdce

Please sign in to comment.