From deb3745f7765fd882ad8df3eb658763e8db97871 Mon Sep 17 00:00:00 2001 From: BryceLTaylor Date: Wed, 20 Apr 2022 10:42:22 -0400 Subject: [PATCH 1/2] circleci add deploy-npm step --- .circleci/config.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f406e9a3..88cee594 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,16 +31,23 @@ aliases: VPKG=$($(npm bin)/json -f package.json version) export RELEASE_VERSION=${VPKG}-prerelease.${RELEASE_TIMESTAMP} echo $RELEASE_VERSION - export NPM_TAG=latest + 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 + npm version --no-git-tag-version $RELEASE_VERSION - &deploy-gh-pages name: "deploy to gh pages" command: | 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 set //registry.npmjs.org/:_authToken=$NPM_TOKEN + npm publish --tag $NPM_TAG jobs: build-test: @@ -75,6 +82,8 @@ jobs: <<: *tag-setup - run: <<: *deploy-gh-pages + - run: + <<: *deploy-npm workflows: build-test-no-deploy: From 85ca4a73e35e55b063284c0ceaaf79cba786a20c Mon Sep 17 00:00:00 2001 From: BryceLTaylor Date: Wed, 20 Apr 2022 15:59:10 -0400 Subject: [PATCH 2/2] circleci push release version to github --- .circleci/config.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 88cee594..2e321aa6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,13 +29,11 @@ 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 + 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 echo export NPM_TAG=hotfix >> $BASH_ENV fi - npm version --no-git-tag-version $RELEASE_VERSION - &deploy-gh-pages name: "deploy to gh pages" command: | @@ -45,9 +43,17 @@ aliases: - &deploy-npm name: "deploy to npm" command: | - echo $NPM_TAG + 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: @@ -84,6 +90,8 @@ jobs: <<: *deploy-gh-pages - run: <<: *deploy-npm + - run: + <<: *tag-commit workflows: build-test-no-deploy: