@ -154,33 +154,51 @@ jobs:
exit 1
exit 1
fi
fi
# Install tea CLI for Gitea
# Use Gitea API directly (more reliable than tea CLI)
cd /tmp
cd ${GITHUB_WORKSPACE}
wget -q https://dl.gitea.com/tea/0.9.2/tea-0.9.2-linux-amd64 -O tea
chmod +x tea
# Configure tea with the repository's Gitea instance
API_URL="${GITHUB_SERVER_URL}/api/v1"
# Remove existing login if present, then add new one
./tea login delete runner 2>/dev/null || true
./tea login add \
--name runner \
--url ${GITHUB_SERVER_URL} \
--token "${GITEA_TOKEN}"
# Verify login works
echo "Creating release via Gitea API..."
./tea login list
echo "API URL: ${API_URL}/repos/${REPO_OWNER}/${REPO_NAME}/releases"
# Create release with assets
# Create the release
cd ${GITHUB_WORKSPACE}
RELEASE_RESPONSE=$(curl -s -X POST \
echo "Creating release with assets..."
-H "Authorization: token ${GITEA_TOKEN}" \
/tmp/tea release create \
-H "Content-Type: application/json" \
--repo ${REPO_OWNER}/${REPO_NAME} \
-d "{\"tag_name\": \"${VERSION}\", \"name\": \"Release ${VERSION}\", \"body\": \"Automated release ${VERSION}\"}" \
--tag ${VERSION} \
"${API_URL}/repos/${REPO_OWNER}/${REPO_NAME}/releases" )
--title "Release ${VERSION}" \
--note "Automated release ${VERSION}" \
echo "Release response: ${RELEASE_RESPONSE}"
--asset release-binaries/orly-${VERSION#v}-linux-amd64 \
--asset release-binaries/libsecp256k1-linux-amd64.so \
# Extract release ID
--asset release-binaries/SHA256SUMS.txt
RELEASE_ID=$(echo "${RELEASE_RESPONSE}" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
echo "Release ${VERSION} created successfully!"
if [ -z "${RELEASE_ID}" ]; then
echo "ERROR: Failed to create release or extract release ID"
echo "Full response: ${RELEASE_RESPONSE}"
exit 1
fi
echo "Release created with ID: ${RELEASE_ID}"
# Upload assets
for ASSET in release-binaries/orly-${VERSION#v}-linux-amd64 release-binaries/libsecp256k1-linux-amd64.so release-binaries/SHA256SUMS.txt; do
FILENAME=$(basename "${ASSET}")
echo "Uploading ${FILENAME}..."
UPLOAD_RESPONSE=$(curl -s -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-F "attachment=@${ASSET}" \
"${API_URL}/repos/${REPO_OWNER}/${REPO_NAME}/releases/${RELEASE_ID}/assets?name=${FILENAME}" )
echo "Upload response for ${FILENAME}: ${UPLOAD_RESPONSE}"
done
echo "Release ${VERSION} created successfully with all assets!"
# Verify release exists
VERIFY=$(curl -s -H "Authorization: token ${GITEA_TOKEN}" \
"${API_URL}/repos/${REPO_OWNER}/${REPO_NAME}/releases/tags/${VERSION}" )
echo "Verification: ${VERIFY}" | head -c 500