diff --git a/Cargo.lock b/Cargo.lock index 83d6185c5a..5829d9e410 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -622,7 +622,7 @@ checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "safer-ffi" -version = "0.1.10-rc3" +version = "0.1.10-rc4" dependencies = [ "async-compat", "cratesio-placeholder-package", @@ -654,7 +654,7 @@ dependencies = [ [[package]] name = "safer_ffi-proc_macros" -version = "0.1.10-rc3" +version = "0.1.10-rc4" dependencies = [ "macro_rules_attribute", "prettyplease", diff --git a/Cargo.toml b/Cargo.toml index 998a5f637d..5b15f7c72b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ path = "src/_lib.rs" [package] name = "safer-ffi" -version = "0.1.10-rc3" # Keep in sync +version = "0.1.10-rc4" # Keep in sync authors = [ "Daniel Henry-Mantilla ", ] @@ -179,7 +179,7 @@ version = "0.0.3" [dependencies.safer_ffi-proc_macros] path = "src/proc_macro" -version = "=0.1.10-rc3" # Keep in sync +version = "=0.1.10-rc4" # Keep in sync [workspace] members = [ diff --git a/ffi_tests/Cargo.lock b/ffi_tests/Cargo.lock index d88dbb3a8d..c16b2573de 100644 --- a/ffi_tests/Cargo.lock +++ b/ffi_tests/Cargo.lock @@ -331,7 +331,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "safer-ffi" -version = "0.1.10-rc3" +version = "0.1.10-rc4" dependencies = [ "futures", "inventory", @@ -348,7 +348,7 @@ dependencies = [ [[package]] name = "safer_ffi-proc_macros" -version = "0.1.10-rc3" +version = "0.1.10-rc4" dependencies = [ "macro_rules_attribute", "prettyplease", diff --git a/js_tests/Cargo.lock b/js_tests/Cargo.lock index 1bd64d0c72..3d590b5c52 100644 --- a/js_tests/Cargo.lock +++ b/js_tests/Cargo.lock @@ -629,7 +629,7 @@ checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "safer-ffi" -version = "0.1.10-rc3" +version = "0.1.10-rc4" dependencies = [ "cratesio-placeholder-package", "inventory", @@ -654,7 +654,7 @@ dependencies = [ [[package]] name = "safer_ffi-proc_macros" -version = "0.1.10-rc3" +version = "0.1.10-rc4" dependencies = [ "macro_rules_attribute", "prettyplease", diff --git a/scripts/cargo_publish.sh b/scripts/cargo_publish.sh new file mode 100755 index 0000000000..17108cbdd5 --- /dev/null +++ b/scripts/cargo_publish.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +# Script to cargo publish a new version of safer-ffi + +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" + +(set -x + git status >&2 +) +if [ -n "$(git status --porcelain)" ]; then + echo >&2 "❌ Uncommitted changes detected." + false +fi + +current_version="$(sed -nE 's/^version = "(.*)"\s*# Keep in sync.*/\1/p' src/proc_macro/Cargo.toml)" +(set -x + current_version="${current_version}" +) + +echo -n "Version desired? [${current_version}] " +read -r desired_version + +set -x +desired_version="${desired_version:-$current_version}" +{ set +x; } 2>/dev/null + +(set -x + ./scripts/change_version.sh "${desired_version}" +) + +if [ -n "$(git status --porcelain)" ]; then + git add -u + (set -x + git commit -m "Version \`${desired_version}\` release" + ) +fi +(set -x + git push +) + +PACKAGES=( + src/proc_macro/ + ./ +) +for package in "${PACKAGES[@]}"; do + (set -x + cd "${package}" + cargo publish + ) +done diff --git a/scripts/change_version.sh b/scripts/change_version.sh new file mode 100755 index 0000000000..5fbc9029ce --- /dev/null +++ b/scripts/change_version.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# Script to bump the `safer-ffi` version of the repo (both in `.toml` and `.lock` files). + +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" + +usage() { + cat >&2 <<-EOF + Usage: + ${0} + Current version: + ${0} $(sed -nE 's/^version = "(.*)"\s*# Keep in sync.*/\1/p' src/proc_macro/Cargo.toml) + EOF + false +} + +new_version="${1:?$(usage)}" + +PACKAGES=( + Cargo.toml + src/proc_macro/Cargo.toml +) + +for package in "${PACKAGES[@]}"; do + ( + set -x + sed -i.bak -E 's/^version = "(=?)(.*)"(\s*# Keep in sync)/version = "\1'"${new_version}"'"\3/' "${package}" + ) + rm "${package}".bak +done + +find . -type f -name 'Cargo.lock' -print0 \ +| while IFS= read -r -d '' lockfile; do + dir="$(dirname ${lockfile})" + ( + set -x + cd "${dir}" && cargo update -vw + ) +done diff --git a/src/proc_macro/Cargo.toml b/src/proc_macro/Cargo.toml index e310c5c90d..13a303089a 100644 --- a/src/proc_macro/Cargo.toml +++ b/src/proc_macro/Cargo.toml @@ -4,7 +4,7 @@ proc-macro = true [package] name = "safer_ffi-proc_macros" -version = "0.1.10-rc3" # Keep in sync +version = "0.1.10-rc4" # Keep in sync authors = ["Daniel Henry-Mantilla "] edition = "2021"