mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Adds a sanity check to prevent clobbering assets on published releases. Otherwise, assets will continue to be pushed to the published release until the version is bumped.
20 lines
609 B
Bash
Executable File
20 lines
609 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euox pipefail
|
|
|
|
# Only clobber existing release assets if the release is a draft
|
|
is_draft=$(gh release view "$TAG_NAME" --json isDraft --jq '.isDraft' | tr -d '\n')
|
|
if [[ "$is_draft" == "true" ]]; then
|
|
clobber="--clobber"
|
|
else
|
|
clobber=""
|
|
fi
|
|
|
|
# This artifact name is tied to the update checker in `gui-client/src-tauri/src/client/updates.rs`
|
|
# So we can't put the version number in it until we stop using Github for update checks.
|
|
gh release upload "$TAG_NAME" \
|
|
"$BINARY_DEST_PATH".msi \
|
|
"$BINARY_DEST_PATH".msi.sha256sum.txt \
|
|
$clobber \
|
|
--repo "$REPOSITORY"
|