Skip to content

Commit

Permalink
feat: Add tests and publish npm jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakprp committed Aug 11, 2023
1 parent 9042b5e commit d25b420
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
failure_message: "Triggered by: *${CIRCLE_USERNAME}* \n\n Ooops! The *$CIRCLE_JOB* job has failed! :circleci-fail:"
webhook: "${SLACK_WEBHOOK_URL}"

publish:
e2e-tests:
working_directory: ~/etherspot-prime-sdk
docker:
- image: cimg/node:18.16.1
Expand Down Expand Up @@ -66,21 +66,38 @@ jobs:
echo $BASH_ENV
rm ~/logs.txt
source "$BASH_ENV"
- slack/status:
failure_message: "Triggered by: *${CIRCLE_USERNAME}* \n\n Ooops! The *$CIRCLE_JOB* job e2e tests failed! :circleci-fail:"
success_message: "Triggered by: *${CIRCLE_USERNAME}* \n\n Woohoh! The *$CIRCLE_JOB* job e2e tests completed successfully! :circleci-pass: \n\n $LOGS"
# only_for_branches: master
webhook: "${SLACK_WEBHOOK_URL}"
publish-npm-package:
working_directory: ~/etherspot-prime-sdk
docker:
- image: cimg/node:18.16.1
auth:
username: $DOCKERHUB_USER
password: $DOCKERHUB_PASSWORD
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$ETHERSPOT_NPM_TOKEN" > ~/etherspot-prime-sdk/.npmrc
- run:
name: Build Etherpot Prime SDK
command: npm run build
- run:
name: Publish package to npm
command: |
cd ~/etherspot-sdk
cd ~/etherspot-prime-sdk
npm publish
- run:
name: Announce Publish
command: |
chmod +x .circleci/announcePublish.sh
.circleci/announcePublish.sh "Etherspot Prime SDK" "$(node -e "console.log(require('./package.json').version)")"
- slack/status:
failure_message: "Triggered by: *${CIRCLE_USERNAME}* \n\n Ooops! The *$CIRCLE_JOB* job e2e tests failed! :circleci-fail:"
success_message: "Triggered by: *${CIRCLE_USERNAME}* \n\n Woohoh! The *$CIRCLE_JOB* job e2e tests completed successfully! :circleci-pass: \n\n $LOGS"
# only_for_branches: master
webhook: "${SLACK_WEBHOOK_URL}"
publish-github-release:
docker:
- image: ardd97/ghr
Expand All @@ -107,10 +124,18 @@ workflows:
branches:
only:
- master
- publish-npm-package:
context: general-vars
requires:
- e2e-tests
filters:
branches:
only:
- master
- publish-github-release:
context: general-vars
requires:
- publish
- e2e-tests
filters:
branches:
only:
Expand Down

0 comments on commit d25b420

Please sign in to comment.