2018-01-25 12:11:32 +01:00
|
|
|
#!/usr/bin/env bash
|
2015-11-23 22:58:54 +01:00
|
|
|
#
|
|
|
|
# Upload a release
|
|
|
|
#
|
2021-02-03 15:44:40 +01:00
|
|
|
# Needs the gh tool from https://github.com/cli/cli
|
2015-11-23 22:58:54 +01:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-02-03 15:44:40 +01:00
|
|
|
REPO="rclone/rclone"
|
2015-11-23 22:58:54 +01:00
|
|
|
|
|
|
|
if [ "$1" == "" ]; then
|
|
|
|
echo "Syntax: $0 Version"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
VERSION="$1"
|
2024-11-16 19:03:02 +01:00
|
|
|
ANCHOR=$(grep '^## v' docs/content/changelog.md | head -n 1 | sed 's/^## //; s/[^A-Za-z0-9-]/-/g; s/--*/-/g')
|
2021-02-03 15:44:40 +01:00
|
|
|
|
|
|
|
cat > "/tmp/${VERSION}-release-notes" <<EOF
|
|
|
|
This is the ${VERSION} release of rclone.
|
2015-11-23 22:58:54 +01:00
|
|
|
|
2021-02-03 15:44:40 +01:00
|
|
|
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}" \
|
2015-11-23 22:58:54 +01:00
|
|
|
--repo ${REPO} \
|
2021-02-03 15:44:40 +01:00
|
|
|
--title "rclone ${VERSION}" \
|
2023-03-15 11:50:28 +01:00
|
|
|
--notes-file "/tmp/${VERSION}-release-notes" \
|
|
|
|
--draft=true
|
2021-02-03 15:44:40 +01:00
|
|
|
|
|
|
|
for build in build/*; do
|
|
|
|
case $build in
|
|
|
|
*current*) continue ;;
|
|
|
|
*testbuilds*) continue ;;
|
|
|
|
esac
|
|
|
|
echo "Uploading ${build} "
|
|
|
|
gh release upload "${VERSION}" \
|
|
|
|
--clobber \
|
2015-11-23 22:58:54 +01:00
|
|
|
--repo ${REPO} \
|
2021-02-03 15:44:40 +01:00
|
|
|
"${build}"
|
2015-11-23 22:58:54 +01:00
|
|
|
done
|
|
|
|
|
2023-03-15 11:50:28 +01:00
|
|
|
gh release edit "${VERSION}" \
|
|
|
|
--repo ${REPO} \
|
|
|
|
--draft=false
|
|
|
|
|
2021-02-03 15:44:40 +01:00
|
|
|
gh release view "${VERSION}" \
|
|
|
|
--repo ${REPO}
|
2015-11-23 22:58:54 +01:00
|
|
|
|
|
|
|
echo "Done"
|