Fix crate dependency patching (#3502)

This commit is contained in:
Rushmore Mushambi 2024-02-13 12:00:21 +02:00 committed by GitHub
parent 842ee7a264
commit 5eacdb0e45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,6 +109,10 @@ jobs:
sed -i "s#^version = \".*\"#version = \"${version}\"#" lib/Cargo.toml
sed -i "s#^version = \".*\"#version = \"${version}\"#" core/Cargo.toml
# Update dependency versions
sed -i "s#surrealdb = { version = \"=${currentVersion}\"#surrealdb = { version = \"${major}\"#" Cargo.toml
sed -i "s#surrealdb-core = { version = \"=${currentVersion}\"#surrealdb-core = { version = \"${major}\"#" lib/Cargo.toml
# Update Cargo.lock without updating dependency versions
cargo check --no-default-features --features storage-mem
@ -138,11 +142,19 @@ jobs:
else
betaVersion=$currentVersion
fi
# Update dependency versions
sed -i "s#surrealdb = { version = \"=${currentVersion}\"#surrealdb = { version = \"=${betaVersion}\"#" Cargo.toml
sed -i "s#surrealdb-core = { version = \"=${currentVersion}\"#surrealdb-core = { version = \"=${betaVersion}\"#" lib/Cargo.toml
else
git checkout -b releases/beta
major=$(echo $currentVersion | tr "." "\n" | sed -n 1p)
minor=$(echo $currentVersion | tr "." "\n" | sed -n 2p)
betaVersion=${major}.${minor}.0-beta.1
# Update dependency versions
sed -i "s#surrealdb = { version = \"${major}\"#surrealdb = { version = \"=${betaVersion}\"#" Cargo.toml
sed -i "s#surrealdb-core = { version = \"${major}\"#surrealdb-core = { version = \"=${betaVersion}\"#" lib/Cargo.toml
fi
# Bump the crate version
@ -150,10 +162,6 @@ jobs:
sed -i "s#^version = \".*\"#version = \"${betaVersion}\"#" lib/Cargo.toml
sed -i "s#^version = \".*\"#version = \"${betaVersion}\"#" core/Cargo.toml
# Update dependency versions
sed -i "s#surrealdb = { version = \"1\"#surrealdb = { version = \"=${betaVersion}\"#" Cargo.toml
sed -i "s#surrealdb-core = { version = \"1\"#surrealdb-core = { version = \"=${betaVersion}\"#" lib/Cargo.toml
# Update Cargo.lock without updating dependency versions
cargo check --no-default-features --features storage-mem
@ -643,7 +651,7 @@ jobs:
# Update the version to a nightly one
sed -i "s#^version = \".*\"#version = \"${version}\"#" lib/Cargo.toml
sed -i "s#^version = \".*\"#version = \"${version}\"#" core/Cargo.toml
sed -i "s#surrealdb-core = { version = \"1\"#surrealdb-core = { version = \"=${version}\"#" lib/Cargo.toml
sed -i "s#surrealdb-core = { version = \"${major}\"#surrealdb-core = { version = \"=${version}\"#" lib/Cargo.toml
- name: Patch crate name and description
if: ${{ inputs.environment == 'nightly' || inputs.environment == 'beta' }}