Skip to content

Commit

Permalink
add build CI to build artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroknots committed Nov 11, 2024
1 parent c863f91 commit 18eda64
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
workflow_dispatch:
push:
branches:
- "main"
pull_request:

jobs:
build:
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-build.yaml@main"

release-artifacts:
needs: ["build"]
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-release.yaml@main"
strategy:
matrix:
contract-name:
[
"SmartSession",
"ERC20SpendingLimitPolicy",
"SudoPolicy",
"UniActionPolicy",
]
with:
contract-name: ${{ matrix.contract-name }}
store-artifacts: true
16 changes: 16 additions & 0 deletions build-artifacts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Check if a contract name is provided
if [ $# -eq 0 ]; then
echo "Please provide a contract name as an argument."
echo "Usage: $0 <ContractName>"
exit 1
fi

CONTRACT_NAME=$1

mkdir -p ./artifacts/$CONTRACT_NAME
forge build $CONTRACT_NAME
cp ./out/$CONTRACT_NAME.sol/* ./artifacts/$CONTRACT_NAME/.
forge verify-contract --show-standard-json-input $(cast address-zero) $CONTRACT_NAME > ./artifacts/$CONTRACT_NAME/verify.json

0 comments on commit 18eda64

Please sign in to comment.