Compare commits
3 Commits
v2025.0625
...
v2025.0626
Author | SHA1 | Date | |
---|---|---|---|
2067caf253 | |||
4d500cbddd | |||
884609f661 |
@ -77,39 +77,59 @@ if ! git config user.email >/dev/null 2>&1; then
|
|||||||
git config user.name "CI Bot"
|
git config user.name "CI Bot"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if tag already exists
|
# Check if tag already exists locally
|
||||||
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
||||||
echo "Tag $TAG already exists, deleting it first..."
|
echo "Tag $TAG already exists locally, deleting it first..."
|
||||||
git tag -d "$TAG"
|
git tag -d "$TAG"
|
||||||
git push origin --delete "$TAG" || true
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git tag -a "$TAG" -m "Release $TAG"
|
# Check if tag exists on remote
|
||||||
if ! git push origin "$TAG"; then
|
if git ls-remote --tags origin | grep -q "refs/tags/$TAG"; then
|
||||||
|
echo "Tag $TAG already exists on remote - this is expected for multi-architecture builds"
|
||||||
|
echo "Skipping tag creation and proceeding with release attachment..."
|
||||||
|
else
|
||||||
|
echo "Creating new tag $TAG..."
|
||||||
|
git tag -a "$TAG" -m "Release $TAG"
|
||||||
|
if ! git push origin "$TAG"; then
|
||||||
echo "Failed to push tag $TAG to origin" >&2
|
echo "Failed to push tag $TAG to origin" >&2
|
||||||
# Try to delete local tag if push failed
|
# Try to delete local tag if push failed
|
||||||
git tag -d "$TAG"
|
git tag -d "$TAG"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Successfully created and pushed tag $TAG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Creating release $TAG on Gitea..."
|
echo "Getting or creating release $TAG on Gitea..."
|
||||||
RELEASE_RESPONSE=$(curl -s -X POST "$API_URL/releases" \
|
|
||||||
|
# First try to get existing release
|
||||||
|
EXISTING_RELEASE=$(curl -s -X GET "$API_URL/releases/tags/$TAG" \
|
||||||
|
-H "Authorization: token $RELEASE_WRITE_TOKEN")
|
||||||
|
|
||||||
|
if echo "$EXISTING_RELEASE" | grep -q '"id":[0-9]*'; then
|
||||||
|
# Release already exists, get its ID
|
||||||
|
RELEASE_ID=$(echo "$EXISTING_RELEASE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||||
|
echo "Release $TAG already exists with ID: $RELEASE_ID"
|
||||||
|
else
|
||||||
|
# Create new release
|
||||||
|
echo "Creating new release $TAG on Gitea..."
|
||||||
|
RELEASE_RESPONSE=$(curl -s -X POST "$API_URL/releases" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: token $RELEASE_WRITE_TOKEN" \
|
-H "Authorization: token $RELEASE_WRITE_TOKEN" \
|
||||||
-d "$RELEASE_DATA")
|
-d "$RELEASE_DATA")
|
||||||
|
|
||||||
echo "Release API response: $RELEASE_RESPONSE"
|
echo "Release API response: $RELEASE_RESPONSE"
|
||||||
|
|
||||||
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||||
|
|
||||||
if [ -z "$RELEASE_ID" ]; then
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
echo "Failed to create release on Gitea." >&2
|
echo "Failed to create release on Gitea." >&2
|
||||||
echo "API URL: $API_URL/releases" >&2
|
echo "API URL: $API_URL/releases" >&2
|
||||||
echo "Release data: $RELEASE_DATA" >&2
|
echo "Release data: $RELEASE_DATA" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Created release with ID: $RELEASE_ID"
|
echo "Created new release with ID: $RELEASE_ID"
|
||||||
|
fi
|
||||||
|
|
||||||
# Upload binaries and install.sh
|
# Upload binaries and install.sh
|
||||||
echo "Uploading assets to release..."
|
echo "Uploading assets to release..."
|
||||||
|
@ -161,7 +161,7 @@ Usage:
|
|||||||
{
|
{
|
||||||
if (mode == "-u")
|
if (mode == "-u")
|
||||||
return update_bb64();
|
return update_bb64();
|
||||||
else if (mode == "-v")
|
else if (mode == "-v" || mode == "version")
|
||||||
{
|
{
|
||||||
std::cout << VERSION << std::endl;
|
std::cout << VERSION << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -202,25 +202,25 @@ function print_summary() {
|
|||||||
|
|
||||||
# Format build status with colors
|
# Format build status with colors
|
||||||
case "$build_status" in
|
case "$build_status" in
|
||||||
"✓") build_col=$(printf " ${GREEN}✓${NC} ") ;;
|
"✓") build_col=$(printf " %s✓%s " "$GREEN" "$NC") ;;
|
||||||
"✗") build_col=$(printf " ${RED}✗${NC} ") ;;
|
"✗") build_col=$(printf " %s✗%s " "$RED" "$NC") ;;
|
||||||
"SKIP") build_col=$(printf " ${YELLOW}-${NC} ") ;;
|
"SKIP") build_col=$(printf " %s-%s " "$YELLOW" "$NC") ;;
|
||||||
*) build_col=" - " ;;
|
*) build_col=" - " ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Format test status with colors
|
# Format test status with colors
|
||||||
case "$test_status" in
|
case "$test_status" in
|
||||||
"✓") test_col=$(printf " ${GREEN}✓${NC} ") ;;
|
"✓") test_col=$(printf " %s✓%s " "$GREEN" "$NC") ;;
|
||||||
"✗") test_col=$(printf " ${RED}✗${NC} ") ;;
|
"✗") test_col=$(printf " %s✗%s " "$RED" "$NC") ;;
|
||||||
"SKIP") test_col=$(printf " ${YELLOW}-${NC} ") ;;
|
"SKIP") test_col=$(printf " %s-%s " "$YELLOW" "$NC") ;;
|
||||||
*) test_col=" - " ;;
|
*) test_col=" - " ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Format publish status with colors
|
# Format publish status with colors
|
||||||
case "$publish_status" in
|
case "$publish_status" in
|
||||||
"✓") publish_col=$(printf " ${GREEN}✓${NC} ") ;;
|
"✓") publish_col=$(printf " %s✓%s " "$GREEN" "$NC") ;;
|
||||||
"✗") publish_col=$(printf " ${RED}✗${NC} ") ;;
|
"✗") publish_col=$(printf " %s✗%s " "$RED" "$NC") ;;
|
||||||
"SKIP") publish_col=$(printf " ${YELLOW}-${NC} ") ;;
|
"SKIP") publish_col=$(printf " %s-%s " "$YELLOW" "$NC") ;;
|
||||||
*) publish_col=" - " ;;
|
*) publish_col=" - " ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user