mirror of
				https://code.forgejo.org/actions/forgejo-release.git
				synced 2025-11-04 06:41:57 +02: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
				
			
		| 
						 | 
				
			
			@ -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:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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