diff --git a/scripts/publish.sh b/scripts/publish.sh index 69a9d37..66b2bcd 100644 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -1,13 +1,18 @@ +#!/bin/bash + set -eu set -o pipefail -scripts_dir="$(dirname $0)" +scripts_dir="$(dirname "$0")" python_script="$scripts_dir/generate-dependency-queue.py" registry_url="https://git.distrust.co/api/packages/public/cargo" search_url="${registry_url}/api/v1/crates" -cargo metadata --format-version=1 | python3 "$python_script" | while read crate version; do +cargo metadata --format-version=1 | python3 "$python_script" | while read -r crate version; do # Verify the package does not exist + if test "${crate}" = "keyfork-tests"; then + continue + fi if ! curl "${search_url}?q=${crate}" 2>/dev/null | jq -e "$(printf '.crates | .[] | select(.name == "%s" and .max_version == "%s")' "$crate" "$version")" >/dev/null; then cargo publish --registry distrust -p "$crate" fi diff --git a/scripts/sign-new-versions.sh b/scripts/sign-new-versions.sh index d0030c2..72f336f 100644 --- a/scripts/sign-new-versions.sh +++ b/scripts/sign-new-versions.sh @@ -1,3 +1,4 @@ +#!/bin/bash set -eu set -o pipefail @@ -8,8 +9,8 @@ temp_file="$(mktemp)" cargo metadata --format-version=1 | jq -r '.packages[] | select(.source == null) | .name + " " + .manifest_path + " " + .version' > "$temp_file" -while read crate manifest_path version <&3; do - crate_path="$(dirname $manifest_path)" +while read -r crate manifest_path version <&3; do + crate_path="$(dirname "$manifest_path")" git_log="$(git log --format='%h %s' "$LAST_REF".."$CURRENT_REF" "$crate_path")" git_tag="$(git tag --list "$crate-v${version}")" if test ! -z "$git_log" -a -z "$git_tag"; then @@ -22,6 +23,7 @@ while read crate manifest_path version <&3; do echo "" echo "# Crate: ${crate} ${version}" } | git tag --sign "${crate}-v${version}" -F - -e + reset echo "Making new tag: ${crate}-v${version}" fi done 3<"$temp_file"