@@ -93,20 +93,17 @@ function get_contract_path {
9393}
9494export -f get_contract_path
9595
96- # Stamps the aztec version into a contract artifact JSON in place. Mirrors stampAztecVersion in
97- # yarn-project/aztec/src/cli/cmds/compile.ts so monorepo-built artifacts match those produced by `aztec compile`.
98- # On release builds (REF_NAME is valid semver) the tag without the leading "v" is used; otherwise "dev" .
99- function stamp_aztec_version {
96+ # Stamps "dev" (DEV_VERSION) as the artifact's aztec_version - that is the expected version of a locally checked out
97+ # monorepo. The real release version is applied at publish time by whichever path owns it:
98+ # ci3/release_prep_package_json for npm packages, release-image/Dockerfile for the docker image .
99+ function stamp_dev_aztec_version {
100100 local json_path=$1
101- # "dev" here corresponds to DEV_VERSION in yarn-project/stdlib/src/update-checker/dev_version.ts.
102- local version=" dev"
103- semver check " $REF_NAME " 2> /dev/null && version=" ${REF_NAME# v} "
104101 local tmp=$( mktemp)
105- jq --arg v " $version " ' .aztec_version = $v ' " $json_path " > " $tmp "
102+ jq ' .aztec_version = "dev" ' " $json_path " > " $tmp "
106103 cat " $tmp " > " $json_path "
107104 rm " $tmp "
108105}
109- export -f stamp_aztec_version
106+ export -f stamp_dev_aztec_version
110107
111108# This compiles a noir contract, transpiles public functions, strips internal prefixes,
112109# and generates verification keys for private functions via 'bb aztec_process'.
@@ -128,9 +125,9 @@ function compile {
128125 $BB aztec_process -i $json_path
129126 cache_upload contract-$contract_hash .tar.gz $json_path
130127 fi
131- # Stamp the current version after the cache block so the field always matches the build's version, whether
132- # the artifact came from a fresh compile or a cache hit.
133- stamp_aztec_version " $json_path "
128+ # Stamp the version after the cache block so the field is always present, whether the artifact came from a fresh
129+ # compile or a cache hit.
130+ stamp_dev_aztec_version " $json_path "
134131}
135132export -f compile
136133
0 commit comments