1
0

return tag

This commit is contained in:
Marco Maatz 2024-10-22 07:53:14 +02:00
parent 7f3b36bd1d
commit b0dc230ea5
2 changed files with 15 additions and 11 deletions

View File

@ -18,6 +18,9 @@ on:
build: build:
description: "Build number" description: "Build number"
value: ${{ jobs.parse.outputs.build }} value: ${{ jobs.parse.outputs.build }}
tag:
description: "Tag"
value: ${{ jobs.parse.outputs.tag }}
releaseChannel: releaseChannel:
description: "The release channel" description: "The release channel"
value: ${{ jobs.parse.outputs.releaseChannel }} value: ${{ jobs.parse.outputs.releaseChannel }}
@ -38,18 +41,18 @@ jobs:
steps: steps:
- id: parseStep - id: parseStep
run: | run: |
input="${{ inputs.version }}" tag="${{ inputs.version }}"
input="${VERSION#refs/tags/}" tag="${VERSION#refs/tags/}"
if [[ "$input" == *"/"* ]]; then if [[ "$tag" == *"/"* ]]; then
releaseChannel=$(echo "$input" | cut -d'/' -f1) releaseChannel=$(echo "$tag" | cut -d'/' -f1)
version=$(echo "$input" | cut -d'/' -f2) version=$(echo "$tag" | cut -d'/' -f2)
else else
releaseChannel="beta" releaseChannel="beta"
version="$input" version="$tag"
fi fi
version=$(echo ${{ inputs.version }} | sed 's|.*/||') version=$(echo "$tag" | sed 's|.*/||')
IFS='.' read -r major minor patch build <<< "$version" IFS='.' read -r major minor patch build <<< "$version"
@ -64,6 +67,7 @@ jobs:
echo "minor=$minor" >> $GITHUB_OUTPUT echo "minor=$minor" >> $GITHUB_OUTPUT
echo "patch=$patch" >> $GITHUB_OUTPUT echo "patch=$patch" >> $GITHUB_OUTPUT
echo "build=$build" >> $GITHUB_OUTPUT echo "build=$build" >> $GITHUB_OUTPUT
echo "tag=$tag" >> $GITHUB_OUTPUT
echo "releaseChannel=$releaseChannel" >> $GITHUB_OUTPUT echo "releaseChannel=$releaseChannel" >> $GITHUB_OUTPUT
echo "simpleVersion=$SIMPLE_VERSION" >> $GITHUB_OUTPUT echo "simpleVersion=$SIMPLE_VERSION" >> $GITHUB_OUTPUT
echo "buildVersion=$BUILD_VERSION" >> $GITHUB_OUTPUT echo "buildVersion=$BUILD_VERSION" >> $GITHUB_OUTPUT

View File

@ -2,7 +2,7 @@ name: Update Release
on: on:
workflow_call: workflow_call:
inputs: inputs:
version: tag:
required: true required: true
type: string type: string
milestoneName: milestoneName:
@ -35,17 +35,17 @@ jobs:
# Fetch Release # Fetch Release
release=$(curl -s -H "Authorization: token $API_TOKEN" \ release=$(curl -s -H "Authorization: token $API_TOKEN" \
"$GITEA_API_URL/repos/$OWNER/${{ inputs.repo }}/releases/tags/${{ inputs.version }}") "$GITEA_API_URL/repos/$OWNER/${{ inputs.repo }}/releases/tags/${{ inputs.tag }}")
# Extract the ID of the Release # Extract the ID of the Release
release_id=$(echo $release | jq -r '.id') release_id=$(echo $release | jq -r '.id')
if [ "$release_id" == "null" ]; then if [ "$release_id" == "null" ]; then
echo "No release for tag '${{ inputs.version }}' found. Exiting." echo "No release for tag '${{ inputs.tag }}' found. Exiting."
exit 0 exit 0
fi fi
echo "Found tag '${{ inputs.version }}' release with ID: $release_id" echo "Found tag '${{ inputs.tag }}' release with ID: $release_id"