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

View file

@ -40,7 +40,7 @@ ensure_tag() {
upload_release() { upload_release() {
local assets=$(ls $RELEASE_DIR/* | sed -e 's/^/-a /') local assets=$(ls $RELEASE_DIR/* | sed -e 's/^/-a /')
local releasetype 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" test ${releasetype+false} || echo "Uploading as Stable"
ensure_tag ensure_tag
anchor=$(echo $TAG | sed -e 's/^v//' -e 's/[^a-zA-Z0-9]/-/g') anchor=$(echo $TAG | sed -e 's/^v//' -e 's/[^a-zA-Z0-9]/-/g')