Require complete release uploads by default
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
This commit is contained in:
@@ -11,6 +11,8 @@ Environment:
|
||||
GITEA_REPO owner/repo, default Palav/dosh
|
||||
GITEA_TOKEN Token with release write permission
|
||||
GITEA_TITLE Release title, default TAG
|
||||
DOSH_RELEASE_ALLOW_PARTIAL=1
|
||||
Allow uploading an incomplete platform set. Default: refuse.
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -31,6 +33,7 @@ repo="${GITEA_REPO:-Palav/dosh}"
|
||||
token="${GITEA_TOKEN:-}"
|
||||
title="${GITEA_TITLE:-$tag}"
|
||||
expected_version="${tag#v}"
|
||||
allow_partial="${DOSH_RELEASE_ALLOW_PARTIAL:-0}"
|
||||
|
||||
artifact_version() {
|
||||
artifact="$1"
|
||||
@@ -80,6 +83,42 @@ if [ "$#" -eq 0 ]; then
|
||||
done
|
||||
fi
|
||||
|
||||
require_complete_release_artifacts() {
|
||||
[ "$allow_partial" = "1" ] && return 0
|
||||
missing=0
|
||||
for required in \
|
||||
dosh-linux-x86_64.tar.gz \
|
||||
dosh-macos-aarch64.tar.gz \
|
||||
dosh-macos-x86_64.tar.gz \
|
||||
dosh-windows-x86_64.zip; do
|
||||
found=0
|
||||
checksum_found=0
|
||||
for artifact in "$@"; do
|
||||
name="$(basename "$artifact")"
|
||||
if [ "$name" = "$required" ]; then
|
||||
found=1
|
||||
fi
|
||||
if [ "$name" = "$required.sha256" ]; then
|
||||
checksum_found=1
|
||||
fi
|
||||
done
|
||||
if [ "$found" -ne 1 ]; then
|
||||
echo "missing required release artifact: $required" >&2
|
||||
missing=1
|
||||
fi
|
||||
if [ "$checksum_found" -ne 1 ]; then
|
||||
echo "missing required release checksum: $required.sha256" >&2
|
||||
missing=1
|
||||
fi
|
||||
done
|
||||
if [ "$missing" -ne 0 ]; then
|
||||
echo "refusing partial release upload; set DOSH_RELEASE_ALLOW_PARTIAL=1 to override" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
require_complete_release_artifacts "$@"
|
||||
|
||||
api="$base/api/v1/repos/$repo"
|
||||
auth_header="Authorization: token $token"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user