Skip to content

Commit eabaf35

Browse files
committed
ci: fix update dependency version
1 parent 96ecb04 commit eabaf35

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,22 @@ jobs:
6969
tmp=$(mktemp)
7070
jq --arg v "$VERSION" '.version = $v' "$TAURI_CONF" > "$tmp" && mv "$tmp" "$TAURI_CONF"
7171
72-
update_cargo_toml() {
73-
local file=$1
74-
if [ -f "$file" ]; then
75-
echo "Updating $file to version $VERSION"
76-
sed "s/^version = .*/version = \"$VERSION\"/" "$file" > "$file.tmp" && mv "$file.tmp" "$file"
77-
else
78-
echo "$file not found"
79-
fi
72+
update_package_version() {
73+
local file=$1
74+
if [ -f "$file" ]; then
75+
echo "Updating package version in $file..."
76+
sed "s/^version = .*/version = \"$VERSION\"/" "$file" > "$file.tmp" && mv "$file.tmp" "$file"
77+
fi
8078
}
8179
82-
update_cargo_toml "Cargo.toml"
83-
update_cargo_toml "pearl_calculator_ui/src-tauri/Cargo.toml"
80+
update_package_version "Cargo.toml"
81+
update_package_version "pearl_calculator_ui/src-tauri/Cargo.toml"
82+
update_package_version "pearl_calculator_core/Cargo.toml"
83+
84+
TARGET_CARGO="pearl_calculator_ui/src-tauri/Cargo.toml"
85+
echo "Updating dependency version in $TARGET_CARGO..."
8486
85-
update_cargo_toml "pearl_calculator_core/Cargo.toml"
87+
sed "s/^pearl_calculator_core = .*/pearl_calculator_core = { path = \"..\/pearl_calculator_core\", version = \"$VERSION\" }/" "$TARGET_CARGO" > "$TARGET_CARGO.tmp" && mv "$TARGET_CARGO.tmp" "$TARGET_CARGO"
8688
8789
- name: Generate Release Body
8890
shell: bash

0 commit comments

Comments
 (0)