storj/scripts/draft-release.sh
Stefan Benten e2481fb510 scripts,Jenkinsfile,Makefile: upload binaries to drafted github release
This change adds a script and the needed build logic to create a draft github release and then upload the created binaries to it in order to make the actual publishing a lot less error prone.
The logic is currently that it only does this for all github tags, but not for every main build/push. This is handled by the checks in the script itself.

Change-Id: Ie172a8e4a97200de901a26a055aa5a8a54b60a2a
2021-12-21 13:55:38 +00:00

29 lines
649 B
Bash
Executable File

#!/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"
github-release release --user storj --repo storj --tag "$TAG" --draft
echo "Uploading binaries to release draft"
for app in $apps;
do
for file in "$FOLDER/$app"*.zip
do
github-release upload --user storj --repo storj --tag "$TAG" --name $(basename "$file") --file "$file"
done
done
echo "Drafting release done"