feat(ghpublish): choose (pre)release depending on tag (#928)
While there, include integration testing to make sure the script is working as intended before using it. While there, edit maketarball.bash's comments.
This commit is contained in:
parent
7df25795c0
commit
ae0613fbb3
9 changed files with 72 additions and 6 deletions
|
|
@ -16,10 +16,18 @@ else
|
|||
__tag=rolling
|
||||
fi
|
||||
|
||||
# 3. determine whether this is a pre-release
|
||||
prerelease="-p"
|
||||
if [[ $__tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
prerelease=""
|
||||
fi
|
||||
|
||||
gh=${gh:-gh}
|
||||
|
||||
set -x
|
||||
|
||||
# 3. create the release as a pre-release unless it already exists
|
||||
gh release create -p $__tag --target $GITHUB_SHA || true
|
||||
# 4. create the release unless it already exists
|
||||
$gh release create $prerelease $__tag --target $GITHUB_SHA || true
|
||||
|
||||
# 4. publish all the assets passed as arguments to the target release
|
||||
gh release upload $__tag --clobber "$@"
|
||||
# 5. publish all the assets passed as arguments to the target release
|
||||
$gh release upload $__tag --clobber "$@"
|
||||
|
|
|
|||
Loading…
Reference in a new issue