Skip to content

Commit

Permalink
Split up release process into PR + release
Browse files Browse the repository at this point in the history
  • Loading branch information
rkalis committed May 4, 2023
1 parent 06c4995 commit 13d19f1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 16 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/create-update-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Create Update PR
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: 16.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 create PR
uses: peter-evans/create-pull-request@v5
with:
commit-message: Update chains based on latest data from chainId.network
title: Update chains based on latest data from chainId.network
body: Update chains based on latest data from chainId.network
branch: update-chains
delete-branch: true
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
name: Update
name: Publish Release
on:
workflow_dispatch:
# Auto-update every week on midnight Monday
schedule:
- cron: '0 0 * * 1'
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12.x'
node-version: 16.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
run: npm 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 }}
Expand Down

0 comments on commit 13d19f1

Please sign in to comment.