#!/bin/bash

source scripts/common.sh

curl -s -X POST \
    -H "Authorization: token $GITHUB_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
        "tag_name": "'$TAG'",
        "name": "Release '$TAG'",
        "body": "Release generated for tag '$TAG'"
    }' \
    https://api.github.com/repos/$GITHUB_REPOSITORY/releases || handle_error "Failed to create release for $TAG"

echo_green_bg "Release $TAG created successfully"