Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
37261db
feat: add core smart contract CI and deploy workflows with environmen…
Le-Caignec Jul 23, 2025
174e278
ci: set fetch-depth to 0 for checkout actions in CI workflows
Le-Caignec Jul 24, 2025
7570060
fix: add missing cache-dependency-path for npm in CI workflow
Le-Caignec Jul 24, 2025
5b3ec47
fix: add push trigger to smart contract deploy workflow
Le-Caignec Jul 24, 2025
33d0ca5
fix: remove push trigger from smart contract deploy workflow
Le-Caignec Jul 24, 2025
3ad582a
fix: add missing cache-dependency-path for npm in smart contract depl…
Le-Caignec Jul 24, 2025
595fe32
feat: add support for Arbitrum mainnet and API V2 verification format
gfournierPro Jul 24, 2025
742429b
fix: rename deploy job to build-and-test in CI workflow
gfournierPro Jul 24, 2025
3d207cb
fix: format code
gfournierPro Jul 24, 2025
1e842a9
fix: add issue reference for Arbitrum mainnet CI support in changelog
gfournierPro Jul 24, 2025
c0a6283
chore: update core-smart-contract-deploy.yml
gfournierPro Jul 24, 2025
732464b
fix: add environment variables and permissions for deploy job in CI w…
gfournierPro Jul 24, 2025
06a3e6a
fix: add step to save deployment artifacts in CI workflow
gfournierPro Jul 24, 2025
22e7dab
fix: add IS_VERIFICATION_API_V2 variable to .env.template
gfournierPro Jul 24, 2025
0ea21a2
fix: remove unused Arbitrum network configurations from Hardhat config
gfournierPro Jul 24, 2025
1766232
fix: add environment validation for mainnet deployments in CI workflow
gfournierPro Jul 24, 2025
9bc5f19
fix: streamline deployment folder naming and improve deployment ID ha…
gfournierPro Jul 24, 2025
f115fa5
fix: ensure newline at end of .env.template for consistency
gfournierPro Jul 25, 2025
f5da62a
fix: make node-version input optional in CI workflow
gfournierPro Jul 25, 2025
4ffd237
fix: improve mainnet deployment validation in CI workflow
gfournierPro Jul 25, 2025
142dbfb
fix: Apply suggestions from code review
gfournierPro Jul 25, 2025
34580db
fix: Update .github/workflows/core-smart-contract-ci.yml
gfournierPro Jul 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/core-smart-contract-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
inputs:
node-version:
description: Node.js version to use
required: true
required: false
type: number
default: 20

Expand Down
42 changes: 40 additions & 2 deletions .github/workflows/core-smart-contract-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ on:
- arbitrum
- bellecour
default: 'hardhat'
environment:
description: 'Environment'
required: true
type: choice
options:
- dev
- prod
default: 'dev'

concurrency:
group: ${{ github.ref }}-core-smart-contract-ci
Expand Down Expand Up @@ -48,6 +56,25 @@ jobs:
working-directory: packages/smart-contract
run: npm ci

- name: Validate deployment environment and prepare variables
if: inputs.network != 'hardhat'
run: |
NETWORK="${{ inputs.network }}"
ENVIRONMENT="${{ inputs.environment }}"

case "$NETWORK" in
arbitrum|bellecour)
if [ "$ENVIRONMENT" = "dev" ]; then
echo "Error: Cannot deploy to mainnet ($NETWORK) with dev environment"
exit 1
fi
echo "IS_MAINNET=true" >> $GITHUB_ENV
;;
*)
echo "IS_MAINNET=false" >> $GITHUB_ENV
;;
esac

- name: Deploy contract
working-directory: packages/smart-contract
env:
Expand All @@ -58,13 +85,24 @@ jobs:
# For Verification
EXPLORER_API_KEY: ${{ secrets.EXPLORER_API_KEY }}
IS_VERIFICATION_API_V2: ${{ vars.IS_VERIFICATION_API_V2 }}
run: npm run deploy -- --network ${{ inputs.network }} --deployment-id ${{ inputs.network }} --verify
run: |
if [ "${{ inputs.network }}" = "hardhat" ]; then
npm run deploy -- --network ${{ inputs.network }} --verify
else
# For testnets, use network-environment; for mainnets, use network only
if [ "$IS_MAINNET" = false ]; then
DEPLOYMENT_ID="${{ inputs.network }}-${{ inputs.environment }}"
else
DEPLOYMENT_ID="${{ inputs.network }}"
fi
npm run deploy -- --network ${{ inputs.network }} --deployment-id "$DEPLOYMENT_ID" --verify
fi

- name: Save deployment artifacts
if: inputs.network != 'hardhat'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: save deployment artifacts for ${{ inputs.network }} (${{ github.run_id }})'
commit_message: 'chore: save deployment artifacts for ${{ inputs.network }} ${{ inputs.environment }} (${{ github.run_id }})'
file_pattern: 'packages/smart-contract/ignition/deployments/*'
commit_user_name: 'GitHub Actions Bot'
commit_user_email: 'github-actions[bot]@users.noreply.github.com'
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-contract/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ MNEMONIC=
EXPLORER_API_KEY=

## Whether to use API V2 verification format
IS_VERIFICATION_API_V2=
IS_VERIFICATION_API_V2=