2021-11-30 19:50:56 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# usage: $0 vMAJOR.MINOR.PATCH[-rc[-*]] PATH/TO/BINARIES
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
apps="identity uplink storagenode multinode"
|
|
|
|
|
|
|
|
TAG="${1-}"
|
|
|
|
|
|
|
|
if ! [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc+(-.*)?)?$ ]]; then
|
|
|
|
echo "No tag detected, skipping release drafting"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
FOLDER="${2-}"
|
|
|
|
|
|
|
|
echo "Drafting release"
|
2022-09-28 17:17:40 +01:00
|
|
|
current_release_version=$(echo "$TAG" | cut -d '.' -f 1-2)
|
|
|
|
previous_release_version=$(git describe --tags $(git rev-list --exclude='*rc*' --exclude=$current_release_version* --tags --max-count=1))
|
2022-09-29 14:22:08 +01:00
|
|
|
changelog=$(python changelog.py "$previous_release_version" "$TAG" 2>&1)
|
2022-09-28 17:17:40 +01:00
|
|
|
github-release release --user storj --repo storj --tag "$TAG" --description "$changelog" --draft
|
2021-11-30 19:50:56 +00:00
|
|
|
|
2022-03-21 14:24:20 +00:00
|
|
|
echo "Sleep 10 seconds in order to wait for release propagation"
|
|
|
|
sleep 10
|
|
|
|
|
2021-11-30 19:50:56 +00:00
|
|
|
echo "Uploading binaries to release draft"
|
2022-09-28 17:17:40 +01:00
|
|
|
for app in $apps; do
|
|
|
|
for file in "$FOLDER/$app"*.zip; do
|
2021-11-30 19:50:56 +00:00
|
|
|
github-release upload --user storj --repo storj --tag "$TAG" --name $(basename "$file") --file "$file"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
echo "Drafting release done"
|