feat: allow skipping assets

This commit is contained in:
Michael Kriese 2026-01-21 09:29:35 +01:00
parent f5b4441975
commit e75cfe89a2
No known key found for this signature in database
GPG key ID: F8D7748549A5986A
3 changed files with 12 additions and 5 deletions

View file

@ -23,7 +23,7 @@ inputs:
default: '${{ forge.token }}' default: '${{ forge.token }}'
release-dir: release-dir:
description: 'Directory in whichs release assets are uploaded or downloaded' description: 'Directory in whichs release assets are uploaded or downloaded'
required: true default: ''
release-notes: release-notes:
description: 'Release notes' description: 'Release notes'
direction: direction:
@ -53,6 +53,9 @@ inputs:
hide-archive-link: hide-archive-link:
description: 'Hide the archive links' description: 'Hide the archive links'
default: false default: false
skip-assets:
description: Skip uploading release assets
default: 'false'
runs: runs:
using: "composite" using: "composite"
@ -113,5 +116,7 @@ runs:
echo -n "${{ inputs.gpg-passphrase }}" > $TMP_DIR/gpg-passphrase echo -n "${{ inputs.gpg-passphrase }}" > $TMP_DIR/gpg-passphrase
export GPG_PASSPHRASE="$TMP_DIR/gpg-passphrase" export GPG_PASSPHRASE="$TMP_DIR/gpg-passphrase"
export SKIP_ASSETS="${{ inputs.skip-assets }}"
forgejo-release.sh ${{ inputs.direction }} forgejo-release.sh ${{ inputs.direction }}
shell: bash shell: bash

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. # 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 # For reference, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions
local assets=() local assets=()
if ! "$SKIP_ASSETS"; then
for file in "$RELEASE_DIR"/*; do for file in "$RELEASE_DIR"/*; do
assets=("${assets[@]}" -a "$file") assets=("${assets[@]}" -a "$file")
done done
fi
if $PRERELEASE || echo "${TAG}" | grep -qi '\-rc'; then if $PRERELEASE || echo "${TAG}" | grep -qi '\-rc'; then
releaseType="--prerelease" releaseType="--prerelease"
echo "Uploading as Pre-Release" echo "Uploading as Pre-Release"

View file

@ -36,7 +36,7 @@ jobs:
direction: upload direction: upload
tag: v2.0 tag: v2.0
token: FORGEJO_TEST_TOKEN token: FORGEJO_TEST_TOKEN
release-dir: upload-dir-v2 skip-assets: true
release-notes: |- release-notes: |-
No shell expansion should on these notes: No shell expansion should on these notes:
- $(some_command) - $(some_command)