Skip to content

Commit

Permalink
[skip ci] update scripts/sign-and-promote-release.sh to use github-re…
Browse files Browse the repository at this point in the history
…leaes instead of gothub, due to lack of -j (json) flag in latest gothub
  • Loading branch information
joemiller committed Apr 11, 2020
1 parent f0a87d3 commit 078ad0f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/sign-and-promote-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
# - upload the shasum signature file
# - promote release from draft to published
#
# requires: gothub - https://github.com/itchio/gothub
# requires:
# - github-release: https://github.com/aktau/github-release
# - jq
# - gpg

set -eou pipefail
shopt -s nullglob
Expand Down Expand Up @@ -42,7 +45,7 @@ trap 'echo "Cleaning up."; rm -rf -- "$tempdir"' EXIT

echo
echo "==> Fetching existing release info for $TAG"
release_info_json=$(gothub info -t "$TAG" -u "$ORG" -r "$REPO" -j)
release_info_json=$(github-release info -t "$TAG" -u "$ORG" -r "$REPO" -j)

echo
echo "==> Generating a list of assets"
Expand All @@ -57,7 +60,7 @@ echo "==> Downloading assets to: $tempdir"
pushd "$tempdir" >/dev/null
for i in "${assets[@]}"; do
echo "==> Downloading: $i"
gothub download -t "$TAG" -u "$ORG" -r "$REPO" -n "$i"
github-release download -t "$TAG" -u "$ORG" -r "$REPO" -n "$i"
done
ls -l "$tempdir"

Expand Down Expand Up @@ -101,14 +104,14 @@ echo "==> Re-uploading modified assets"
#for i in ./*; do
for i in "${modified_assets[@]}"; do
echo "==> Uploading: $i"
gothub upload -t "$TAG" -u "$ORG" -r "$REPO" -n "$(basename "$i")" -f "$i" --replace
github-release upload -t "$TAG" -u "$ORG" -r "$REPO" -n "$(basename "$i")" -f "$i" --replace
done

echo
echo "==> Promoting release from draft to published"
# in order to preserve the current description we must provide it to the edit command:
description="$(jq -r '.Releases[0].body' <<<"$release_info_json")"
gothub edit -t "$TAG" -u "$ORG" -r "$REPO" -d "$description"
github-release edit -t "$TAG" -u "$ORG" -r "$REPO" -d "$description"

echo
echo "DONE!"
Expand Down

0 comments on commit 078ad0f

Please sign in to comment.