Skip to content

Commit

Permalink
Merge pull request #5 from etherspot/feature/pipeline
Browse files Browse the repository at this point in the history
Add pipeline config, license and other templates
  • Loading branch information
arddluma authored Jun 15, 2023
2 parents 9607d7f + e600f55 commit ddf1b23
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 3 deletions.
94 changes: 94 additions & 0 deletions .circleci/publish.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-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
26 changes: 26 additions & 0 deletions .github/pull_request_template.md
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)
24 changes: 24 additions & 0 deletions .github/workflows/check-package-version.yml
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
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 🚀
21 changes: 21 additions & 0 deletions LICENSE
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.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Etherspot Lite SDK

# Etherspot Prime SDK
## Account Abstraction (ERC-4337) SDK
![MIT licensed][license-image]

<a href="https://www.etherspot.io">
<img src=".github/logo.png" width="100"/>
<img src="https://public.etherspot.io/assets/etherspot.png" width="100"/>
</a>


Expand Down
7 changes: 7 additions & 0 deletions SECURITY.md
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.

0 comments on commit ddf1b23

Please sign in to comment.