Skip to content

Commit

Permalink
Merge pull request #15 from rkalis/main
Browse files Browse the repository at this point in the history
Add GitHub Actions workflow to update periodically
  • Loading branch information
taylorjdawson authored Mar 24, 2023
2 parents 08af7f3 + 7bb2904 commit 06c4995
Show file tree
Hide file tree
Showing 6 changed files with 8,405 additions and 462 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/main.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Update
on:
workflow_dispatch:
# Auto-update every week on midnight Monday
schedule:
- cron: '0 0 * * 1'
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn
- name: Generate new files
run: yarn generate && yarn build
- name: Update version (major if there are deletions in enums.ts, otherwise minor)
run: git diff src/enums.ts | grep "^-[^-]" && yarn version --major --no-git-tag-version || yarn version --minor --no-git-tag-version
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
default_author: 'github_actions'
message: 'Update chains based on latest data from chainId.network'
- name: Publish to npm
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get package.json info
id: package_json
uses: jaywcjlove/github-action-package@main
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package_json.outputs.version }}
release_name: v${{ steps.package_json.outputs.version }}
body: Update chains based on latest data from chainId.network
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eth-chains",
"version": "1.0.0",
"version": "3.0.0",
"description": "Helper module for getting Ethereum chains info.",
"author": "Taylor Dawson",
"main": "dist/index.js",
Expand All @@ -17,9 +17,9 @@
"prepack": "yarn build"
},
"devDependencies": {
"got": "^11.8.2",
"@types/node": "^14.14.37",
"@types/prettier": "^2.2.3",
"got": "^11.8.2",
"prettier": "^2.2.1",
"ts-node": "^9.1.1",
"typescript": "^4.2.3"
Expand Down
Loading

0 comments on commit 06c4995

Please sign in to comment.