-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from etherspot/feature/pipeline
Add pipeline config, license and other templates
- Loading branch information
Showing
7 changed files
with
181 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,94 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
slack: circleci/[email protected] | ||
|
||
jobs: | ||
install: | ||
working_directory: ~/etherspot-prime-sdk | ||
docker: | ||
- image: cimg/node:18.16.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-prime-sdk/.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-prime-sdk | ||
docker: | ||
- image: cimg/node:18.16.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-prime-sdk/.npmrc | ||
- run: | ||
name: Build Etherpot Prime SDK | ||
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 Prime SDK" "$(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 |
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,26 @@ | ||
<!--- Provide a general summary of your changes in the Title above --> | ||
|
||
## Description | ||
<!--- Describe your changes in detail --> | ||
- | ||
|
||
## Motivation and Context | ||
<!--- Why is this change required? What problem does it solve? --> | ||
<!--- If it fixes an open issue, please link to the issue here. --> | ||
- | ||
|
||
## How Has This Been Tested? | ||
<!--- Please describe in detail how you tested your changes. --> | ||
<!--- Include details of your testing environment, and the tests you ran to --> | ||
<!--- see how your change affects other areas of the code, etc. --> | ||
- | ||
- | ||
- | ||
|
||
## Screenshots (if appropriate): | ||
|
||
## Types of changes | ||
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> | ||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to change) |
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,24 @@ | ||
name: Check if package version is updated | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
start: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Check if version has been updated | ||
id: check | ||
uses: EndBug/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
file-name: ./package.json | ||
- name: Log when changed | ||
if: steps.check.outputs.changed == 'true' | ||
run: 'echo "Yayy!! Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"' | ||
- name: Log when unchanged | ||
if: steps.check.outputs.changed == 'false' | ||
run: echo "No version change :/ Please update version in package.json!" && exit 1 |
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,6 @@ | ||
# Changelog | ||
|
||
## [1.0.0] - 2023-06-01 | ||
|
||
### New | ||
- Initial version published 🚀 |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Etherspot | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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
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,7 @@ | ||
# Reporting security issues | ||
|
||
If you think you have found a security vulnerability, please send an email to [[email protected]](mailto:[email protected]). This address can be used for all of Etherspot's open source (including but not limited to SDK, Prime SDK, BUIDler, React Etherspot Kit). | ||
|
||
Etherspot will send you a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. | ||
|
||
**Important:** We ask you to not disclose the vulnerability before it have been fixed and announced, unless you received a response from the Etherspot security team that you can do so. |