fix: Make release-dir and assets optional

This commit is contained in:
Jan Willhaus 2025-08-31 12:33:08 +02:00
parent 9223b9c0d5
commit fdadfb4c64
2 changed files with 6 additions and 2 deletions

View file

@ -22,8 +22,8 @@ inputs:
description: 'Forgejo application token'
default: '${{ forge.token }}'
release-dir:
description: 'Directory in whichs release assets are uploaded or downloaded'
required: true
description: 'Directory in which release assets are uploaded or downloaded'
default: dist/release
release-notes:
description: 'Release notes'
direction:

View file

@ -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() {