Skip to content

Commit

Permalink
NPM registry (#6)
Browse files Browse the repository at this point in the history
* interface added

* interface moved to right folder

* missing function interface added

* new contract deployed

* NPM registry

* test.yaml edited

* test.yaml edited

---------

Co-authored-by: Lesther Caballero <[email protected]>
  • Loading branch information
itslesther and Lesther Caballero authored Sep 4, 2024
1 parent 2ac01a5 commit 6458782
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 133 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release & Publish

on:
push:
tags:
- '*'

permissions:
contents: write
packages: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .npmrc file to publish to npm
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install modules
run: npm install
- name: Build
run: npm run build
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build & Test

on:
push:
branches: [main, develop, "feat/*"]
paths-ignore:
- "README.md"
- "LICENSE"
- "example/**"
pull_request:
branches: [main]
paths-ignore:
- "README.md"
- "LICENSE"
- "example/**"

jobs:
e2e-test:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: 'npm'
cache-dependency-path: package-lock.json
- name: "Install dependencies"
run: npm install
- name: "Run tests"
run: npm test

23 changes: 23 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.babelrc
.eslintignore
.eslintrc.json
.eslintrc.js
.gitignore
.lintstagedrc.json
.nycrc
.github
.prettierrc.json
.prettierignore
*.log


coverage/
benchmark/
.coverage/
cypress/
fixtures/
tmp/
logs/
test/
scripts/
.idea/
2 changes: 0 additions & 2 deletions contracts/SWTRImplementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,6 @@ contract SWTRImplementation is ISWTRProxy, OwnableUpgradeable {
issuerAddress
);

require(verificationData.length > 0, "No verification data found");

for (uint256 i = 0; i < verificationData.length; i++) {
if (
verificationData[i].verificationType == uint32(verificationType)
Expand Down
7 changes: 5 additions & 2 deletions package-lock.json

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

20 changes: 18 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
{
"name": "swisstronik-sdi-contracts",
"name": "@swisstronik/sdi-contracts",
"version": "1.0.0",
"description": "Swisstronik SDI contracts",
"homepage": "https://github.com/SigmaGmbH/swisstronik-sdi-contracts",
"bugs": {
"url": "https://github.com/SigmaGmbH/swisstronik-sdi-contracts/issues"
},
"contributors": [
"Denis <[email protected]>",
"Lesther Caballero <[email protected]>"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/SigmaGmbH/swisstronik-sdi-contracts.git"
},
"dependencies": {
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@openzeppelin/contracts": "^5.0.2",
Expand All @@ -13,6 +28,7 @@
},
"scripts": {
"hardhat:compile": "hardhat compile --force",
"hardhat:deploy": "hardhat run scripts/deploy.ts --network testnet"
"hardhat:deploy": "hardhat run scripts/deploy.ts --network testnet",
"test": "hardhat test"
}
}
127 changes: 0 additions & 127 deletions test/Lock.ts

This file was deleted.

0 comments on commit 6458782

Please sign in to comment.