forked from taylorjdawson/eth-chains
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from rkalis/main
Add GitHub Actions workflow to update periodically
- Loading branch information
Showing
6 changed files
with
8,405 additions
and
462 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.