Skip to content

Commit

Permalink
Resolved conflicts and Merge branch 'master' of https://github.com/et…
Browse files Browse the repository at this point in the history
  • Loading branch information
ch4r10t33r committed May 10, 2022
2 parents f428e2e + d053161 commit 4982188
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .circleci/announcePublish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -euo pipefail

applicationName=$1
package=$2

payload=$(
cat <<EOM
{
"attachments": [
{
"fallback": "A new version of $applicationName is available for use. :circleci-pass:",
"color": "#33CC66",
"pretext": "A new version of $applicationName is available for use. :circleci-pass:",
"title": "$CIRCLE_PROJECT_REPONAME",
"title_link": "https://github.com/etherspot/etherspot-contracts/releases/tag/$package",
"text": "Version: etherspot-contracts@$package",
"ts": $(date '+%s')
}
]
}
EOM
)

curl -X POST --data-urlencode payload="$payload" "$SLACK_WEBHOOK_URL"
94 changes: 94 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
version: 2.1

orbs:
slack: circleci/[email protected]

jobs:
install:
working_directory: ~/etherspot-contracts
docker:
- image: circleci/node:14.17.0
auth:
username: $DOCKERHUB_USER
password: $DOCKERHUB_PASSWORD
steps:
- checkout
- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$ETHERSPOT_NPM_TOKEN" > ~/etherspot-contracts/.npmrc
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- slack/status:
fail_only: true
failure_message: "Triggered by: *${CIRCLE_USERNAME}* \n\n Ooops! The *$CIRCLE_JOB* job has failed! :circleci-fail:"
webhook: "${SLACK_WEBHOOK_URL}"

publish:
working_directory: ~/etherspot-contracts
docker:
- image: circleci/node:14.17.0
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-contracts/.npmrc
- run:
name: Build Etherpot contracts
command: npm run build
- run:
name: Publish package to npm
command: npm publish
- run:
name: Announce Publish
command: |
chmod +x .circleci/announcePublish.sh
.circleci/announcePublish.sh "Etherspot Contracts" "$(node -e "console.log(require('./package.json').version)")"
- slack/status:
fail_only: true
failure_message: "Triggered by: *${CIRCLE_USERNAME}* \n\n Ooops! The *$CIRCLE_JOB* job has failed! :circleci-fail:"
only_for_branches: master
webhook: "${SLACK_WEBHOOK_URL}"
publish-github-release:
docker:
- image: ardd97/ghr
steps:
- checkout
- run:
name: "Publish Release on GitHub"
command: |
PACKAGE_VERSION="$(jq .version package.json -r)"
echo $PACKAGE_VERSION
ghr -t "${GITHUB_TOKEN}" -u "${CIRCLE_PROJECT_USERNAME}" -r "${CIRCLE_PROJECT_REPONAME}" -c "${CIRCLE_SHA1}" "$PACKAGE_VERSION"
workflows:
version: 2.1
install_and_publish:
jobs:
- install:
context: general-vars
- publish:
context: general-vars
requires:
- install
filters:
branches:
only:
- master
- publish-github-release:
context: general-vars
filters:
branches:
only:
- master
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@etherspot/contracts",
"version": "1.5.0",
"version": "1.5.1",
"description": "Etherspot Solidity contracts",
"keywords": [
"ether",
Expand Down

0 comments on commit 4982188

Please sign in to comment.