Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Solidity contract

Solidity contract #11

name: CI
on:
push:
branches: [ main ]
paths: [ tm-community-contracts/** ]
pull_request:
branches: [ main ]
paths: [ tm-community-contracts/** ]
jobs:
code-checks:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tm-community-contracts
steps:
- uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Run tests
run: forge test -vvv
deploy-contract:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tm-community-contracts
steps:
- uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Deploy to Sepolia
id: deploy
env:
ETH_RPC_NAME: eth-sepolia
ETH_RPC_URL: ${{ secrets.RPC_ETH_SEPOLIA_HTTPS }}
PRIVATE_KEY: ${{ secrets.TM_SEPOLIA_DEPLOYER_PK }}
OWNER: ${{ vars.TM_SEPOLIA_OWNER_ADDRESS }}
run: |
forge build
createOutput=`forge create TrueMintCommunity --json --rpc-url=$ETH_RPC_URL --private-key=$PRIVATE_KEY --constructor-args $OWNER`
echo "createOutput=$createOutput" >> $GITHUB_OUTPUT
- name: Comment deployment
uses: thollander/actions-comment-pull-request@v2
with:
message: |
**Contract deployed to Sepolia** :rocket:
- Deployer: [${{ fromJson(steps.deploy.outputs.createOutput).deployer }}](https://sepolia.etherscan.io/address/${{ fromJson(steps.deploy.outputs.createOutput).deployer }})
- Deployed to: [${{ fromJson(steps.deploy.outputs.createOutput).deployedTo }}](https://sepolia.etherscan.io/address/${{ fromJson(steps.deploy.outputs.createOutput).deployedTo }})
- Transaction hash: [${{ fromJson(steps.deploy.outputs.createOutput).transactionHash }}](https://sepolia.etherscan.io/tx/${{ fromJson(steps.deploy.outputs.createOutput).transactionHash }})
comment_tag: sepolia_deployment