#!/bin/bash
# Set your GitHub credentials
USERNAME="your_username"
TOKEN="your_personal_access_token"
# Specify the repository
OWNER="repository_owner"
REPO="repository_name"
# Set the release tag name and target commitish (branch or commit SHA)
TAG_NAME="v1.0.0"
TARGET_COMMITISH="main"
# Set the release name, body, and draft status
NAME="Release v1.0.0"
BODY="This is the release body."
DRAFT=false
# Create the release using cURL
curl -X POST \
-u "$USERNAME:$TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/$OWNER/$REPO/releases" \
-d '{
"tag_name": "'"$TAG_NAME"'",
"target_commitish": "'"$TARGET_COMMITISH"'",
"name": "'"$NAME"'",
"body": "'"$BODY"'",
"draft": '"$DRAFT"'
}'