build: update

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-07-17 16:27:55 +02:00
parent 04baf49360
commit e7305c2d45

View File

@ -4,9 +4,13 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
version: version:
description: "format %y.%-m.$i or auto" description: "format %y.%m.$d or auto"
required: false required: false
type: string type: string
latest:
description: "latest"
default: true
type: boolean
prerelease: prerelease:
description: "pre release" description: "pre release"
default: false default: false
@ -40,12 +44,7 @@ jobs:
if [ -n "${{ inputs.version }}" ]; then if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}" VERSION="${{ inputs.version }}"
else else
LATEST_TAG="$(curl -skL "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r ".tag_name" 2>/dev/null)" VERSION="`date +'%y.%m.%d'`"
if [[ -n "${LATEST_TAG}" && "`echo ${LATEST_TAG} | cut -d '.' -f 1,2`" = "`date +'%y.%-m.%-d'`" ]]; then # format %y.%-m.$i
VERSION="`echo ${LATEST_TAG} | awk -F '.' '{$3=$3+1}1' OFS='.'`"
else
VERSION="`date +'%y.%-m.%-d'`"
fi
fi fi
if [ -n "${VERSION}" ]; then if [ -n "${VERSION}" ]; then
@ -74,6 +73,7 @@ jobs:
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
tag: ${{ env.VERSION }} tag: ${{ env.VERSION }}
makeLatest: ${{ inputs.latest }}
prerelease: ${{ inputs.prerelease }} prerelease: ${{ inputs.prerelease }}
allowUpdates: true allowUpdates: true
body: | body: |