mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 05:52:42 -05:00
Merge pull request #1960 from LLK/hotfix/circleci-deploy-npm
Hotfix/circleci deploy npm
This commit is contained in:
commit
3db719655e
1 changed files with 21 additions and 4 deletions
|
@ -29,11 +29,10 @@ aliases:
|
|||
command: |
|
||||
RELEASE_TIMESTAMP="$(date +'%Y%m%d%H%M%S')"
|
||||
VPKG=$($(npm bin)/json -f package.json version)
|
||||
export RELEASE_VERSION=${VPKG}-prerelease.${RELEASE_TIMESTAMP}
|
||||
echo $RELEASE_VERSION
|
||||
export NPM_TAG=latest
|
||||
echo export RELEASE_VERSION=${VPKG}-prerelease.${RELEASE_TIMESTAMP} >> $BASH_ENV
|
||||
echo export NPM_TAG=latest >> $BASH_ENV
|
||||
if [[ "$CIRCLE_BRANCH" == hotfix/* ]]; then # double brackets are important for matching the wildcard
|
||||
export NPM_TAG=hotfix
|
||||
echo export NPM_TAG=hotfix >> $BASH_ENV
|
||||
fi
|
||||
- &deploy-gh-pages
|
||||
name: "deploy to gh pages"
|
||||
|
@ -41,6 +40,20 @@ aliases:
|
|||
git config --global user.email $(git log --pretty=format:"%ae" -n1)
|
||||
git config --global user.name $(git log --pretty=format:"%an" -n1)
|
||||
npm run deploy -- -e $CIRCLE_BRANCH
|
||||
- &deploy-npm
|
||||
name: "deploy to npm"
|
||||
command: |
|
||||
echo "npm tag: $NPM_TAG"
|
||||
echo "release version: $RELEASE_VERSION"
|
||||
npm version --no-git-tag-version $RELEASE_VERSION
|
||||
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
|
||||
npm publish --tag $NPM_TAG
|
||||
- &tag-commit
|
||||
name: "tag commit in github"
|
||||
command: |
|
||||
echo $RELEASE_VERSION
|
||||
git tag $RELEASE_VERSION
|
||||
git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
|
@ -75,6 +88,10 @@ jobs:
|
|||
<<: *tag-setup
|
||||
- run:
|
||||
<<: *deploy-gh-pages
|
||||
- run:
|
||||
<<: *deploy-npm
|
||||
- run:
|
||||
<<: *tag-commit
|
||||
|
||||
workflows:
|
||||
build-test-no-deploy:
|
||||
|
|
Loading…
Reference in a new issue