Skip to content
Merged
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ on:
description: 'Allowed deployment sender address'
type: string
required: false
version_postfix:
description: 'Postfix appended to VERSION constants in Solidity source before compilation (e.g., -beta, -rc1)'
type: string
required: false
default: ''
secrets:
rpc_url:
description: 'RPC endpoint URL'
Expand Down Expand Up @@ -115,6 +120,18 @@ jobs:
echo "EVM suffix will be auto-detected from foundry.toml during deployment"
grep -A 1 "solc_version" "$FOUNDRY_CONFIG"

- name: Apply version postfix
if: inputs.version_postfix != ''
env:
VERSION_POSTFIX: ${{ inputs.version_postfix }}
run: |
grep -rl 'string public constant VERSION' src/ --include="*.sol" | while read file; do
cp "$file" "${file}.version-bak"
sed -i "s/\(string public constant VERSION = \"[^\"]*\)\";/\1${VERSION_POSTFIX}\";/" "$file"
echo "Applied postfix to $file:"
grep 'string public constant VERSION' "$file"
done

- name: Run deployment script
env:
DEPLOY_SCRIPT: ${{ inputs.deploy_script }}
Expand All @@ -138,6 +155,13 @@ jobs:
echo "Restored original foundry.toml"
fi

# Restore VERSION-modified Solidity files
for bakfile in $(find src/ -name "*.version-bak" 2>/dev/null); do
original="${bakfile%.version-bak}"
mv "$bakfile" "$original"
echo "Restored $original"
done

- name: Check for changes
id: git-check
run: |
Expand Down