Merge pull request 'Add ability to manually specify pre-releases' (#3) from Neshura/forgejo-release:main into main

Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/3
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
This commit is contained in:
earl-warren 2024-01-03 21:38:31 +00:00
commit 54df7acad2
2 changed files with 7 additions and 2 deletions

View file

@ -32,7 +32,10 @@ inputs:
verbose:
description: 'Increase the verbosity level'
default: 'false'
prerelease:
description: 'Mark Release as Pre-Release'
default: 'false'
runs:
using: "composite"
steps:
@ -60,6 +63,8 @@ runs:
TAG=${TAG##refs/tags/}
fi
export PRERELEASE="${{ inputs.prerelease }}"
export TOKEN="${{ inputs.token }}"
export RELEASE_DIR="${{ inputs.release-dir }}"

View file

@ -40,7 +40,7 @@ ensure_tag() {
upload_release() {
local assets=$(ls $RELEASE_DIR/* | sed -e 's/^/-a /')
local releasetype
echo "${TAG}" | grep -qi '\-rc' && export releasetype="--prerelease" && echo "Uploading as Pre-Release"
( $PRERELEASE || echo "${TAG}" | grep -qi '\-rc' ) && export releasetype="--prerelease" && echo "Uploading as Pre-Release"
test ${releasetype+false} || echo "Uploading as Stable"
ensure_tag
anchor=$(echo $TAG | sed -e 's/^v//' -e 's/[^a-zA-Z0-9]/-/g')