Merge pull request #87 from bandohq/chore/configure-script #7
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
name: Build ABIs | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
paths: | |
- '**/*.sol' | |
- 'deployments/**' | |
jobs: | |
build-abis: | |
runs-on: ubuntu-latest | |
name: Build ABIs | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Install packages | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
- name: Build ABIs | |
run: | | |
yarn | |
forge build | |
- name: Checkout contract-abis | |
uses: actions/checkout@v3 | |
with: | |
repository: bandohq/contract-abis | |
token: ${{ secrets.GH_PAT }} | |
path: abis_repo | |
- name: Copy and commit ABIs | |
run: | | |
cd abis_repo | |
git rm -r * | |
cd .. | |
mkdir -p abis_repo/abis | |
mkdir -p abis_repo/contracts | |
CONTRACT_NAMES=("FulfillableRegistryV1" "ERC20TokenRegistryV1" "BandoFulfillmentManagerV1" "BandoRouterV1" "BandoERC20FulfillableV1" "BandoFulfillableV1") | |
for contract_name in "${CONTRACT_NAMES[@]}"; do | |
abi_file="out/$contract_name.sol/$contract_name.json" | |
if [ -f "$abi_file" ]; then | |
cp "$abi_file" abis_repo/abis/ | |
else | |
echo "ABI for $contract_name not found at $abi_file" | |
fi | |
done | |
cp -r deployments/* abis_repo/contracts/ | |
cd abis_repo | |
git config user.name "bando-bot" | |
git config user.email "[email protected]" | |
git add . | |
DATE=$(date '+%Y-%m-%d') | |
git diff --staged --quiet || git commit -m "Update BFP EVM Contracts $DATE" | |
VERSION=$(date '+%Y%m%d%H%M%S') | |
git tag -a "v$VERSION" -m "Release v$VERSION" | |
git push origin main --tags |