@@ -76,28 +76,30 @@ jobs:
76
76
# list all aztec-packages tags, take the "highest" version
77
77
monorepo_tag="$(git tag --list aztec-packages-v* | sort --version-sort | tail -1)"
78
78
monorepo_protocol_circuits_path="yarn-project/noir-protocol-circuits"
79
- nargo_file="$SUBREPO_PATH/aztec/Nargo.toml"
79
+
80
+ # take all Nargo.toml files that reference noir-protocol-circuits
81
+ nargo_files="$(find $SUBREPO_PATH -name 'Nargo.toml' | xargs grep --files-with-matches 'noir-protocol-circuits')"
80
82
81
83
# match lines like this:
82
84
# protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }
83
85
# and replace with
84
86
# protocol_types = { git="https://github.com/aztecprotocol/aztec-packages", tag="aztec-packages-v0.16.9", directory="yarn-project/noir-protocol-circuits/src/crates/types" }
85
- sed --regexp-extended --in-place \
86
- "s;path\s*=\s*\".*noir-protocol-circuits(.*)\";git=\"$monorepo_url\", tag=\"$monorepo_tag\", directory=\"$monorepo_protocol_circuits_path\1\";" \
87
- $nargo_file
87
+ for nargo_file in $nargo_files; do
88
+ sed --regexp-extended --in-place \
89
+ "s;path\s*=\s*\".*noir-protocol-circuits(.*)\";git=\"$monorepo_url\", tag=\"$monorepo_tag\", directory=\"$monorepo_protocol_circuits_path\1\";" \
90
+ $nargo_file
91
+ done
88
92
89
93
git commit --all --message "chore: replace relative paths to noir-protocol-circuits"
90
94
91
95
if ./scripts/git_subrepo.sh push $SUBREPO_PATH --branch=master; then
92
96
git fetch # in case a commit came after this
93
97
git rebase origin/master
94
98
95
- # restore old Nargo.toml
96
- # We have to go back two generations. History looks like this:
97
- # HEAD <--- the commit generated by git_subrepo
98
- # HEAD~1 <--- the chore commit created above
99
- # HEAD~2 <--- the original commit we were supposed to mirror or the tip of master after rebase
100
- git restore --source=HEAD~2 -- $nargo_file
99
+ # restore old files
100
+ for nargo_file in $nargo_files; do
101
+ git restore --source=origin/master -- $nargo_file
102
+ done
101
103
git commit --all --amend -m "$(git log -1 --pretty=%B) [skip ci]"
102
104
103
105
git push
0 commit comments