Skip to content

Commit 3ef4655

Browse files
committed
workflow to publish package
1 parent a71dd26 commit 3ef4655

File tree

4 files changed

+87
-50
lines changed

4 files changed

+87
-50
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Node.js Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: 12
15+
- run: npm ci
16+
- run: npm test
17+
18+
publish-gpr:
19+
needs: build
20+
runs-on: ubuntu-latest
21+
permissions:
22+
packages: write
23+
contents: read
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: 12
29+
registry-url: https://npm.pkg.github.com/
30+
- run: npm ci
31+
- run: npm publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.npmignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ test
1919
.gitignore
2020
.eslintrc.json
2121
.prettierrc.json
22-
tmp.js
22+
tmp.js
23+
24+
# github
25+
.github

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://npm.pkg.github.com

package.json

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
{
2-
"name": "ethereum-block-by-date",
3-
"version": "1.4.5",
4-
"description": "Get Ethereum block number by a given date. Or blocks by a given period duration.",
5-
"keywords": [
6-
"ethereum",
7-
"blockchain",
8-
"web3",
9-
"eth",
10-
"dapp",
11-
"utilties"
12-
],
13-
"homepage": "https://github.com/monosux/ethereum-block-by-date",
14-
"repository": {
15-
"type": "git",
16-
"url": "https://github.com/monosux/ethereum-block-by-date.git"
17-
},
18-
"bugs": {
19-
"url": "https://github.com/monosux/ethereum-block-by-date/issues"
20-
},
21-
"author": "Sergey Alexeev <alexeev.sergey.a@gmail.com>",
22-
"license": "MIT",
23-
"main": "./lib/ethereum-block-by-date.js",
24-
"dependencies": {
25-
"moment": "^2.29.2"
26-
},
27-
"scripts": {
28-
"build": "rimraf lib && babel src -d lib",
29-
"test": "npm run build && mocha && npm run lint",
30-
"lint": "eslint src",
31-
"prettier": "prettier src --write",
32-
"style": "yarn lint && yarn prettier"
33-
},
34-
"devDependencies": {
35-
"@babel/cli": "^7.17.6",
36-
"@babel/core": "^7.17.8",
37-
"@babel/preset-env": "^7.16.11",
38-
"chai": "^4.3.6",
39-
"dotenv": "^16.0.0",
40-
"eslint": "^8.12.0",
41-
"ethers": "^5.6.2",
42-
"mocha": "^9.2.2",
43-
"prettier": "^2.6.2",
44-
"rimraf": "^3.0.2",
45-
"web3": "^1.7.1"
46-
},
47-
"browserslist": [
48-
"last 2 chrome versions",
49-
"maintained node versions"
50-
]
2+
"name": "ethereum-block-by-date",
3+
"version": "1.4.5",
4+
"description": "Get Ethereum block number by a given date. Or blocks by a given period duration.",
5+
"keywords": [
6+
"ethereum",
7+
"blockchain",
8+
"web3",
9+
"eth",
10+
"dapp",
11+
"utilties"
12+
],
13+
"homepage": "https://github.com/monosux/ethereum-block-by-date",
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/monosux/ethereum-block-by-date.git"
17+
},
18+
"bugs": {
19+
"url": "https://github.com/monosux/ethereum-block-by-date/issues"
20+
},
21+
"author": "Sergey Alexeev <alexeev.sergey.a@gmail.com>",
22+
"license": "MIT",
23+
"main": "./lib/ethereum-block-by-date.js",
24+
"dependencies": {
25+
"moment": "^2.29.2"
26+
},
27+
"scripts": {
28+
"build": "rimraf lib && babel src -d lib",
29+
"test": "npm run build && mocha && npm run lint",
30+
"lint": "eslint src",
31+
"prettier": "prettier src --write",
32+
"style": "yarn lint && yarn prettier"
33+
},
34+
"devDependencies": {
35+
"@babel/cli": "^7.17.6",
36+
"@babel/core": "^7.17.8",
37+
"@babel/preset-env": "^7.16.11",
38+
"chai": "^4.3.6",
39+
"dotenv": "^16.0.0",
40+
"eslint": "^8.12.0",
41+
"ethers": "^5.6.2",
42+
"mocha": "^9.2.2",
43+
"prettier": "^2.6.2",
44+
"rimraf": "^3.0.2",
45+
"web3": "^1.7.1"
46+
},
47+
"browserslist": [
48+
"last 2 chrome versions",
49+
"maintained node versions"
50+
]
5151
}

0 commit comments

Comments
 (0)