-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved conflicts and Merge branch 'master' of https://github.com/et…
- Loading branch information
Showing
4 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters