Merge pull request #1960 from LLK/hotfix/circleci-deploy-npm

Hotfix/circleci deploy npm
This commit is contained in:
Bryce Taylor 2022-04-21 11:31:15 -04:00 committed by GitHub
commit 3db719655e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: