1 | name: Auto-update ABI JSON file
|
2 | on:
|
3 | schedule:
|
4 | - cron: '0 * * * *'
|
5 | jobs:
|
6 | autoupdate:
|
7 | runs-on: ubuntu-latest
|
8 | steps:
|
9 | - uses: actions/checkout@v2
|
10 | - uses: actions/setup-node@v1
|
11 | with:
|
12 | node-version: '12.x'
|
13 | - name: Get npm cache directory
|
14 | id: npm-cache
|
15 | run: |
|
16 | echo "::set-output name=dir::$(npm config get cache)"
|
17 | - uses: actions/cache@v1
|
18 | with:
|
19 | path: ${{ steps.npm-cache.outputs.dir }}
|
20 | key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
21 | restore-keys: |
|
22 | ${{ runner.os }}-node-
|
23 | - run: npm install --no-package-lock
|
24 | - name: Update ABI registry
|
25 | run: npm run update-abi-registry
|
26 | - name: Commit Changes to ABI registry
|
27 | env:
|
28 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
29 | run: |
|
30 | echo "machine github.com login $GITHUB_ACTOR password $GITHUB_TOKEN" > ~/.netrc
|
31 | chmod 600 ~/.netrc
|
32 | git add abi_registry.json
|
33 | if test -n "$(git status -s)"; then
|
34 | git config user.name "GitHub Actions"
|
35 | git config user.email "github-actions@users.noreply.github.com"
|
36 | git diff --cached
|
37 | git commit -m "feat: update ABI registry"
|
38 | git push origin HEAD:$GITHUB_REF
|
39 | else
|
40 | echo No update needed
|
41 | fi
|
42 |
|
\ | No newline at end of file |