Skip to content

Commit a814c96

Browse files
authored
feat: contract addresses package
feat: contract addresses package
2 parents d14d8e7 + 9e848c9 commit a814c96

File tree

12 files changed

+1335
-0
lines changed

12 files changed

+1335
-0
lines changed

.github/workflows/publish-npm.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish Contract Addresses
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
update:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
registry-url: 'https://registry.npmjs.org'
20+
21+
- run: npm ci
22+
- run: npm run fetch
23+
24+
- name: Check for changes
25+
id: changes
26+
run: |
27+
git add data/
28+
if git diff --staged --quiet; then
29+
echo "changed=false" >> $GITHUB_OUTPUT
30+
else
31+
echo "changed=true" >> $GITHUB_OUTPUT
32+
fi
33+
34+
- name: Publish if changed
35+
if: steps.changes.outputs.changed == 'true'
36+
run: |
37+
VERSION="1.0.$(date +%Y%m%d%H%M%S)"
38+
npm version $VERSION --no-git-tag-version
39+
40+
npm run build
41+
npm publish --access public
42+
43+
git config user.name "github-actions"
44+
git config user.email "[email protected]"
45+
git add .
46+
git commit -m "Update addresses v$VERSION"
47+
git push
48+
env:
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ dist
128128
# Stores VSCode versions used for testing VSCode extensions
129129
.vscode-test
130130

131+
# JetBrains IDEs
132+
.idea
133+
131134
# yarn v2
132135
.yarn/cache
133136
.yarn/unplugged

.npmignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Source files
2+
src/
3+
tsconfig.json
4+
5+
# Development files
6+
.github/
7+
*.md
8+
.gitignore
9+
10+
# Dependencies
11+
node_modules/
12+
13+
# Logs and temp files
14+
logs/
15+
*.log
16+
tmp/
17+
temp/
18+
19+
# Environment files
20+
.env*
21+
22+
# IDE
23+
.vscode/
24+
.idea/
25+
26+
# OS
27+
.DS_Store
28+
Thumbs.db

0 commit comments

Comments
 (0)