mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
ci: fix calls to scripts expecting Travis
This commit is contained in:
parent
e6d3673164
commit
44bed7ecdf
1 changed files with 38 additions and 38 deletions
|
@ -4,34 +4,26 @@ orbs:
|
||||||
commands:
|
commands:
|
||||||
deploy_npm:
|
deploy_npm:
|
||||||
steps:
|
steps:
|
||||||
- when:
|
- run:
|
||||||
condition:
|
# This relies on deploy_gh_pages to set git user info first
|
||||||
or:
|
name: Deploy to NPM
|
||||||
- equal: [ master, <<pipeline.git.branch>> ]
|
command: |
|
||||||
- equal: [ develop, <<pipeline.git.branch>> ]
|
export RELEASE_VERSION="0.11.$(date +%Y%m%d%H%M%S)"
|
||||||
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
|
if [[ "$CIRCLE_BRANCH" == hotfix/* ]]; then
|
||||||
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
|
export NPM_TAG=hotfix
|
||||||
steps:
|
else
|
||||||
- run:
|
export NPM_TAG=latest
|
||||||
# This relies on deploy_gh_pages to set git user info first
|
fi
|
||||||
name: Deploy to NPM
|
echo "Deploying version $RELEASE_VERSION to $NPM_TAG"
|
||||||
command: |
|
npm --no-git-tag-version version $RELEASE_VERSION
|
||||||
export RELEASE_VERSION="0.11.$(date +%Y%m%d%H%M%S)"
|
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
|
||||||
if [[ "$CIRCLE_BRANCH" == hotfix/* ]]; then
|
npm publish --tag $NPM_TAG
|
||||||
export NPM_TAG=hotfix
|
if npm info | grep -q $RELEASE_VERSION; then
|
||||||
else
|
git tag $RELEASE_VERSION
|
||||||
export NPM_TAG=latest
|
git push \
|
||||||
fi
|
https://${GH_TOKEN}@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git \
|
||||||
echo "Deploying version $RELEASE_VERSION to $NPM_TAG"
|
$RELEASE_VERSION
|
||||||
npm --no-git-tag-version version $RELEASE_VERSION
|
fi
|
||||||
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
|
|
||||||
npm publish --tag $NPM_TAG
|
|
||||||
if npm info | grep -q $RELEASE_VERSION; then
|
|
||||||
git tag $RELEASE_VERSION
|
|
||||||
git push \
|
|
||||||
https://${GH_TOKEN}@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git \
|
|
||||||
$RELEASE_VERSION
|
|
||||||
fi
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
default:
|
default:
|
||||||
|
@ -44,20 +36,28 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install libgif-dev
|
sudo apt install libgif-dev
|
||||||
travis/setup-git.sh
|
TRAVIS_BRANCH="${CIRCLECI_BRANCH}" travis/setup-git.sh
|
||||||
travis/install-assets.sh
|
travis/install-assets.sh
|
||||||
npm set progress=false
|
npm set progress=false
|
||||||
which gulp || sudo npm install -g gulp-cli
|
which gulp || sudo npm install -g gulp-cli
|
||||||
- run: npm install # TODO: switch to node/install-packages after adding package_lock.json
|
- run: npm install # TODO: switch to node/install-packages after adding package_lock.json
|
||||||
- run:
|
- run: gulp jshint
|
||||||
name: Build & Test
|
- run: gulp minify
|
||||||
command: |
|
- run: gulp test
|
||||||
gulp jshint
|
- run: gulp zip
|
||||||
gulp minify
|
- when:
|
||||||
gulp test
|
condition:
|
||||||
gulp zip
|
or:
|
||||||
[ "${TRAVIS_BRANCH}" = "develop" ] && [ "${TRAVIS_NODE_VERSION}" = "stable" ] && travis/deploy-prebuilt.sh || true
|
- equal: [ master, <<pipeline.git.branch>> ]
|
||||||
- deploy_npm
|
- equal: [ develop, <<pipeline.git.branch>> ]
|
||||||
|
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
|
||||||
|
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: travis/deploy-prebuilt.sh
|
||||||
|
command: |
|
||||||
|
TRAVIS_TAG="${CIRCLE_TAG}" TRAVIS_COMMIT="${CIRCLE_SHA1}" travis/deploy-prebuilt.sh
|
||||||
|
- deploy_npm
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue