mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-28 17:02:24 -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:
|
||||
deploy_npm:
|
||||
steps:
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: [ master, <<pipeline.git.branch>> ]
|
||||
- equal: [ develop, <<pipeline.git.branch>> ]
|
||||
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
|
||||
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
|
||||
steps:
|
||||
- run:
|
||||
# This relies on deploy_gh_pages to set git user info first
|
||||
name: Deploy to NPM
|
||||
command: |
|
||||
export RELEASE_VERSION="0.11.$(date +%Y%m%d%H%M%S)"
|
||||
if [[ "$CIRCLE_BRANCH" == hotfix/* ]]; then
|
||||
export NPM_TAG=hotfix
|
||||
else
|
||||
export NPM_TAG=latest
|
||||
fi
|
||||
echo "Deploying version $RELEASE_VERSION to $NPM_TAG"
|
||||
npm --no-git-tag-version version $RELEASE_VERSION
|
||||
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
|
||||
- run:
|
||||
# This relies on deploy_gh_pages to set git user info first
|
||||
name: Deploy to NPM
|
||||
command: |
|
||||
export RELEASE_VERSION="0.11.$(date +%Y%m%d%H%M%S)"
|
||||
if [[ "$CIRCLE_BRANCH" == hotfix/* ]]; then
|
||||
export NPM_TAG=hotfix
|
||||
else
|
||||
export NPM_TAG=latest
|
||||
fi
|
||||
echo "Deploying version $RELEASE_VERSION to $NPM_TAG"
|
||||
npm --no-git-tag-version version $RELEASE_VERSION
|
||||
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:
|
||||
default:
|
||||
|
@ -44,20 +36,28 @@ jobs:
|
|||
command: |
|
||||
sudo apt update
|
||||
sudo apt install libgif-dev
|
||||
travis/setup-git.sh
|
||||
TRAVIS_BRANCH="${CIRCLECI_BRANCH}" travis/setup-git.sh
|
||||
travis/install-assets.sh
|
||||
npm set progress=false
|
||||
which gulp || sudo npm install -g gulp-cli
|
||||
- run: npm install # TODO: switch to node/install-packages after adding package_lock.json
|
||||
- run:
|
||||
name: Build & Test
|
||||
command: |
|
||||
gulp jshint
|
||||
gulp minify
|
||||
gulp test
|
||||
gulp zip
|
||||
[ "${TRAVIS_BRANCH}" = "develop" ] && [ "${TRAVIS_NODE_VERSION}" = "stable" ] && travis/deploy-prebuilt.sh || true
|
||||
- deploy_npm
|
||||
- run: gulp jshint
|
||||
- run: gulp minify
|
||||
- run: gulp test
|
||||
- run: gulp zip
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: [ master, <<pipeline.git.branch>> ]
|
||||
- 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:
|
||||
version: 2
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue