Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

build: update GitHub release tool to use gh and put a link to changelog

Nick Craig-Wood644cc69108f7
diff --git a/bin/upload-github b/bin/upload-github
index a78a60d31..f4fa1cdc7 100755
--- a/bin/upload-github
+++ b/bin/upload-github
@@ -2,49 +2,45 @@
#
# Upload a release
#
-# Needs github-release from https://github.com/aktau/github-release
+# Needs the gh tool from https://github.com/cli/cli
set -e
-REPO="rclone"
+REPO="rclone/rclone"
if [ "$1" == "" ]; then
echo "Syntax: $0 Version"
exit 1
fi
VERSION="$1"
-if [ "$GITHUB_USER" == "" ]; then
- echo 1>&2 "Need GITHUB_USER environment variable"
- exit 1
-fi
-if [ "$GITHUB_TOKEN" == "" ]; then
- echo 1>&2 "Need GITHUB_TOKEN environment variable"
- exit 1
-fi
+ANCHOR=$(grep '^## v' docs/content/changelog.md | head -1 | sed 's/^## //; s/[^A-Za-z0-9-]/-/g; s/--*/-/g')
+
+cat > "/tmp/${VERSION}-release-notes" <<EOF
+This is the ${VERSION} release of rclone.
-echo "Making release ${VERSION}"
-github-release release \
+Full details of the changes can be found in [the changelog](https://rclone.org/changelog/#${ANCHOR}).
+EOF
+
+echo "Making release ${VERSION} anchor ${ANCHOR} to repo ${REPO}"
+
+gh release create "${VERSION}" \
--repo ${REPO} \
- --tag ${VERSION} \
- --name "rclone" \
- --description "Rclone - rsync for cloud storage. Sync files to and from many cloud storage providers."
-
-for build in `ls build | grep -v current | grep -v testbuilds`; do
- echo "Uploading ${build}"
- base="${build%.*}"
- parts=(${base//-/ })
- os=${parts[3]}
- arch=${parts[4]}
-
- github-release upload \
+ --title "rclone ${VERSION}" \
+ --notes-file "/tmp/${VERSION}-release-notes"
+
+for build in build/*; do
+ case $build in
+ *current*) continue ;;
+ *testbuilds*) continue ;;
+ esac
+ echo "Uploading ${build} "
+ gh release upload "${VERSION}" \
+ --clobber \
--repo ${REPO} \
- --tag ${VERSION} \
- --name "${build}" \
- --file build/${build}
+ "${build}"
done
-github-release info \
- --repo ${REPO} \
- --tag ${VERSION}
+gh release view "${VERSION}" \
+ --repo ${REPO}
echo "Done"