Skip to content

Commit 5bed224

Browse files
committed
Add GitHub package registry configuration and update package.json for publishing
1 parent f52dce9 commit 5bed224

7 files changed

Lines changed: 63 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v4
20+
21+
- name: Enable Corepack
22+
run: corepack enable
23+
24+
- name: Set up Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
registry-url: https://npm.pkg.github.com
29+
scope: '@originprotocol'
30+
cache: pnpm
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Build package
36+
run: pnpm run build
37+
38+
- name: Publish package
39+
run: pnpm publish --no-git-checks
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@originprotocol:registry=https://npm.pkg.github.com
2+
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}

lib/abi/multicall.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/abi/multicall.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,24 @@
33
"version": "1.0.0",
44
"description": "",
55
"packageManager": "pnpm@10.24.0",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/OriginProtocol/squid-utils.git"
9+
},
610
"main": "lib/index.js",
711
"types": "lib/index.d.ts",
812
"files": [
913
"lib/**/*"
1014
],
15+
"publishConfig": {
16+
"access": "restricted",
17+
"registry": "https://npm.pkg.github.com"
18+
},
1119
"scripts": {
1220
"build": "tsc",
21+
"prepack": "pnpm run build",
22+
"publish:dry-run": "pnpm publish --dry-run --no-git-checks",
23+
"publish:github": "pnpm publish --registry https://npm.pkg.github.com --no-git-checks",
1324
"test": "echo \"Error: no test specified\" && exit 1",
1425
"prepare": "husky install"
1526
},
@@ -21,6 +32,7 @@
2132
"@subsquid/evm-abi": "^1.0.0",
2233
"@subsquid/evm-codec": "^1.0.0",
2334
"@subsquid/evm-processor": "1.28.0-portal-api.721f49",
35+
"@subsquid/rpc-client": "^4.14.0",
2436
"@subsquid/typeorm-store": "^1.9.1",
2537
"dayjs": "^1.11.13",
2638
"lodash": "^4.17.21",

pnpm-lock.yaml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"module": "commonjs",
4-
"target": "es2020",
4+
"target": "es2022",
55
"outDir": "lib",
66
"rootDir": "src",
77
"strict": true,

0 commit comments

Comments
 (0)