Skip to content

Commit

Permalink
ci: add step to build the ABIs
Browse files Browse the repository at this point in the history
  • Loading branch information
anhnguyenbitmark committed Feb 28, 2024
1 parent 4b68ed0 commit 8d470ea
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/abi-gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Generate ABIs

on:
pull_request:
branches: [ main ]
# paths:
# - '**/*.sol'

jobs:
gen-abi:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: NodeJS Setup
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install Truffle globally
run: npm install -g truffle sol-merger

- name: Install abigen
run: go install github.com/ethereum/go-ethereum/cmd/abigen@latest

- name: Write secret.json file
env:
MNEMONIC: ${{ secrets.MNEMONIC }}
MAINNET_ENDPOINT: ${{ secrets.MAINNET_ENDPOINT }}
GOERLI_ENDPOINT: ${{ secrets.GOERLI_ENDPOINT }}
BSCTEST_ENDPOINT: ${{ secrets.BSCTEST_ENDPOINT }}
BSC_ENDPOINT: ${{ secrets.BSC_ENDPOINT }}
ETHERSCAN_API: ${{ secrets.ETHERSCAN_API }}
BSC_API: ${{ secrets.BSC_API }}
run: |
cat <<EOF > .secret.json
{
"mnemonic": "${MNEMONIC}",
"mainnet_endpoint": "${MAINNET_ENDPOINT}",
"goerli_endpoint": "${GOERLI_ENDPOINT}",
"bsctest_endpoint": "${BSCTEST_ENDPOINT}",
"bsc_endpoint": "${BSC_ENDPOINT}",
"etherscan_api": "${ETHERSCAN_API}",
"bsc_api": "${BSC_API}"
}
EOF
- name: Generate ABI files
run: |
make build
- name: Commit and push the generated ABI files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Generate ABIs for PR #${{github.event.pull_request.number}}"
file_pattern: '*.go'
commit_user_name: Bitmark Bot
commit_user_email: [email protected]

0 comments on commit 8d470ea

Please sign in to comment.