summaryrefslogtreecommitdiffstats
path: root/vendor/git2/ci/publish.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/git2/ci/publish.sh
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/git2/ci/publish.sh')
-rwxr-xr-xvendor/git2/ci/publish.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/vendor/git2/ci/publish.sh b/vendor/git2/ci/publish.sh
new file mode 100755
index 000000000..69c2556bc
--- /dev/null
+++ b/vendor/git2/ci/publish.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+set -e
+
+function publish {
+ publish_this="$1"
+ crate_name="$2"
+ manifest="$3"
+
+ if [ "$publish_this" != "true" ]
+ then
+ echo "Skipping $crate_name, publish not requested."
+ return
+ fi
+
+ # Get the version from Cargo.toml
+ version=`sed -n -E 's/^version = "(.*)"/\1/p' $manifest`
+
+ # Check crates.io if it is already published
+ set +e
+ output=`curl --fail --silent --head https://crates.io/api/v1/crates/$crate_name/$version/download`
+ res="$?"
+ set -e
+ case $res in
+ 0)
+ echo "${crate_name}@${version} appears to already be published"
+ return
+ ;;
+ 22) ;;
+ *)
+ echo "Failed to check ${crate_name}@${version} res: $res"
+ echo "$output"
+ exit 1
+ ;;
+ esac
+
+ cargo publish --manifest-path $manifest --no-verify
+
+ tag="${crate_name}-${version}"
+ git tag $tag
+ git push origin "$tag"
+}
+
+publish $PUBLISH_LIBGIT2_SYS libgit2-sys libgit2-sys/Cargo.toml
+publish $PUBLISH_GIT2 git2 Cargo.toml
+publish $PUBLISH_GIT2_CURL git2-curl git2-curl/Cargo.toml