Files
repoCat/.gitea/scripts/get-release-id.sh
Max P. 078948fda1 feat(ci): add workflows for automated releases and nightly builds
- Add workflows for nightly builds and automated releases using Gitea
- Introduce scripts for version management, release ID retrieval, and
  asset uploads
- Update changelog generation and conflict handling mechanisms
- Improve release automation with semantic versioning support
2025-05-11 14:14:59 +02:00

22 lines
577 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Eingaben
TAG="$1"
TOKEN="${ACTIONS_RUNTIME_TOKEN:-<fallback_token>}"
REPO="${GITHUB_REPOSITORY:-owner/example}"
API="${GITHUB_API_URL:-https://gitea.example.tld/api/v1}"
OWNER=$(echo "$REPO" | cut -d/ -f1)
NAME=$(echo "$REPO" | cut -d/ -f2)
RESPONSE=$(curl -sf \
-H "Authorization: token $TOKEN" \
"$API/repos/$OWNER/$NAME/releases/tags/$TAG")
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
echo "Release-ID für $TAG ist: $RELEASE_ID"
# Für GitHub Actions als Umgebungsvariable
echo "GT_RELEASE_ID=$RELEASE_ID" >> "$GITHUB_ENV"