mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2025-09-07 08:31:55 +03:00
fix: Make release-dir and assets optional
This commit is contained in:
parent
9223b9c0d5
commit
fdadfb4c64
2 changed files with 6 additions and 2 deletions
|
@ -84,9 +84,11 @@ upload_release() {
|
|||
# It is expanded using "${assets[@]}" which preserves the separation of arguments and not split whitespace containing values.
|
||||
# For reference, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions
|
||||
local assets=()
|
||||
shopt -s nullglob
|
||||
for file in "$RELEASE_DIR"/*; do
|
||||
assets=("${assets[@]}" -a "$file")
|
||||
done
|
||||
shopt -u nullglob
|
||||
if $PRERELEASE || echo "${TAG}" | grep -qi '\-rc'; then
|
||||
releaseType="--prerelease"
|
||||
echo "Uploading as Pre-Release"
|
||||
|
@ -131,12 +133,14 @@ sign_release() {
|
|||
passphrase="--passphrase-file $GPG_PASSPHRASE"
|
||||
fi
|
||||
gpg --import --no-tty --pinentry-mode loopback $passphrase "$GPG_PRIVATE_KEY"
|
||||
shopt -s nullglob
|
||||
for asset in "$RELEASE_DIR"/*; do
|
||||
if [[ $asset =~ .sha256$ ]]; then
|
||||
continue
|
||||
fi
|
||||
gpg --armor --detach-sign --no-tty --pinentry-mode loopback $passphrase <"$asset" >"$asset".asc
|
||||
done
|
||||
shopt -u nullglob
|
||||
}
|
||||
|
||||
maybe_sign_release() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue