Skip to content

Commit

Permalink
ci: publish package on npm (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev authored Jun 14, 2023
1 parent e302174 commit 1b63a40
Show file tree
Hide file tree
Showing 6 changed files with 1,328 additions and 253 deletions.
Binary file added .DS_Store
Binary file not shown.
31 changes: 31 additions & 0 deletions .github/workflows/publish-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to NPM

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: yarn install

- name: Build
run: yarn build

- name: Publish to NPM
run: yarn publish --new-version ${GITHUB_REF#refs/tags/v} --no-git-tag-version
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_REF: ${{ github.ref }}
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Hardhat tasks for the ZetaChain template
# ZetaChain Toolkit

This repository contains a collection of helper contracts, Hardhat tasks, and
utility functions that make it easier to build with ZetaChain.

## Prerequisites

Expand All @@ -21,14 +24,7 @@ To install all the the tasks into a Hardhat template, add the following import
statement to `hardhat.config.js`:

```ts
import "@zetachain/tasks";
```

You can also import specific tasks:

```ts
import "@zetachain/tasks/account";
import "@zetachain/tasks/balances";
import "@zetachain/toolkit/tasks";
```

## Compiling Tasks
Expand Down
17 changes: 13 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "@zetachain/tasks",
"version": "1.0.0",
"name": "@zetachain/toolkit",
"version": "0.0.0-set-on-publish",
"description": "",
"main": "dist/index.js",
"scripts": {
"build": "rm -rf dist && npx hardhat clean && npx hardhat compile && tsc",
"prebuild": "npx hardhat clean && rimraf dist",
"build": "npx cpx './templates/**/*' ./dist/templates && npx hardhat compile && tsc || exit 0",
"postbuild": "rimraf dist/typechain-types",
"lint:fix": "npm run lint:js:fix && npm run lint:sol:fix",
"lint:js:fix": "eslint --ext .js,.ts . --fix",
"lint:js": "eslint --ext .js,.ts .",
Expand Down Expand Up @@ -45,6 +47,7 @@
"bech32": "^2.0.0",
"bip39": "^3.1.0",
"chai": "^4.2.0",
"cpx": "^1.5.0",
"dotenv": "^16.0.3",
"envfile": "^6.18.0",
"eslint": "^8.42.0",
Expand All @@ -60,6 +63,7 @@
"handlebars": "^4.7.7",
"hardhat": "^2.14.0",
"hardhat-gas-reporter": "^1.0.8",
"rimraf": "^5.0.1",
"prettier": "^2.8.8",
"prettier-plugin-solidity": "^1.1.3",
"sinon": "^15.1.0",
Expand All @@ -68,5 +72,10 @@
"ts-node": ">=8.0.0",
"typechain": "^8.1.0",
"typescript": ">=4.5.0"
}
},
"files": [
"contracts",
"dist",
"typechain-types"
]
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"strict": true,
"typeRoots": ["@types", "./node_modules/@types"]
},
"include": ["helpers", "tasks"]
"include": ["helpers", "tasks"],
"exclude": ["./typechain-types"]
}
Loading

0 comments on commit 1b63a40

Please sign in to comment.