Skip to content

feat: add version_postfix input for pre-compilation VERSION patching#1

Merged
boyuanx merged 1 commit intomainfrom
feat/version-postfix
Feb 27, 2026
Merged

feat: add version_postfix input for pre-compilation VERSION patching#1
boyuanx merged 1 commit intomainfrom
feat/version-postfix

Conversation

@boyuanx
Copy link
Contributor

@boyuanx boyuanx commented Feb 27, 2026

Summary

  • Adds a new version_postfix workflow input (string, optional, default '')
  • When provided, appends the postfix to all string public constant VERSION declarations in src/ before forge script runs
  • Restores original source files after deployment (via .version-bak pattern) so no source changes leak into committed artifacts

Use case

UUPS-proxied contracts bake VERSION into bytecode at compile time. This lets callers tag deployments (e.g., -beta, -rc1) without modifying source permanently.

Test plan

  • Trigger workflow with version_postfix: "-test" on a testnet
  • Verify version() on deployed proxy returns e.g. "2.0.0-SignUBIStaking-test"
  • Verify committed artifacts contain no source file changes
  • Trigger with empty postfix — original VERSION unchanged

Allow callers to append a custom postfix (e.g., -beta, -rc1) to
`string public constant VERSION` in Solidity sources before forge
compiles. The original files are restored after deployment so no
source changes leak into committed artifacts.
@boyuanx boyuanx merged commit cf965c5 into main Feb 27, 2026
1 check passed
@boyuanx boyuanx deleted the feat/version-postfix branch February 27, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant