@@ -73,10 +73,10 @@ jobs:
7373 id : check_version
7474 working-directory : ./rust/main
7575 run : |
76- # Get current version from Cargo.toml
77- CURRENT_VERSION=$(grep '^ version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/ ')
76+ # Get current version from hyperlane-agents.version file
77+ CURRENT_VERSION=$(cat hyperlane-agents. version | tr -d '[:space:] ')
7878 echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
79- echo "Current Cargo.toml version: $CURRENT_VERSION"
79+ echo "Current hyperlane-agents. version: $CURRENT_VERSION"
8080
8181 # Get latest agents-v* tag
8282 LATEST_TAG=$(git tag -l "agents-v*" --sort=-version:refname | grep -E "^agents-v[0-9]+\.[0-9]+\.[0-9]+$" | head -1)
@@ -200,32 +200,15 @@ jobs:
200200 echo "$CHANGELOG"
201201 echo 'EOF'
202202 } >> $GITHUB_OUTPUT
203- - name : Update Cargo.toml version
204- working-directory : ./rust/main
205- env :
206- NEW_VERSION : ${{ steps.next_version.outputs.new_version }}
207- run : |
208- # Update only the workspace version (first occurrence under [workspace.package])
209- # Use awk to only replace the version in the [workspace.package] section
210- awk -v new_ver="$NEW_VERSION" '
211- /^\[workspace\.package\]/ { in_workspace=1 }
212- /^\[/ && !/^\[workspace\.package\]/ { in_workspace=0 }
213- in_workspace && /^version = / && !replaced {
214- print "version = \"" new_ver "\""
215- replaced=1
216- next
217- }
218- { print }
219- ' Cargo.toml > Cargo.toml.tmp
220- mv Cargo.toml.tmp Cargo.toml
221-
222- echo "Updated Cargo.toml to version $NEW_VERSION"
223- git diff Cargo.toml
224- - name : Update CHANGELOG
203+ - name : Update version files
225204 working-directory : ./rust/main
226205 env :
227206 NEW_VERSION : ${{ steps.next_version.outputs.new_version }}
228207 run : |
208+ # Update hyperlane-agents.version file
209+ echo "$NEW_VERSION" > hyperlane-agents.version
210+ echo "Updated hyperlane-agents.version to $NEW_VERSION"
211+
229212 # Prepend new version to CHANGELOG.md
230213 if [ -f CHANGELOG.md ]; then
231214 CURRENT_CHANGELOG=$(cat CHANGELOG.md)
@@ -260,7 +243,7 @@ jobs:
260243 git checkout -B "$BRANCH_NAME"
261244
262245 # Stage changes
263- git add rust/main/Cargo.toml rust/main/CHANGELOG.md
246+ git add rust/main/CHANGELOG.md rust/main/hyperlane-agents.version
264247
265248 # Commit changes
266249 git commit -m "release: agents v${NEW_VERSION}
0 commit comments