Skip to content

Commit

Permalink
testing github action 11
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekinstnt committed Sep 17, 2024
1 parent 4de7c0d commit 50a406e
Showing 1 changed file with 33 additions and 26 deletions.
59 changes: 33 additions & 26 deletions aries/wrappers/uniffi-aries-vcx/scripts/ios.build.cargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,37 +174,44 @@

if [ "$RELEASE_ID" == "null" ]; then
echo "Release not found for tag: $TAG"
exit 1
fi

else
echo "Found release ID: $RELEASE_ID"

# Fetch all assets for the release
ASSET_URL="https://api.github.com/repos/$REPO/releases/$RELEASE_ID/assets"
ASSETS_JSON=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "$ASSET_URL")
# Delete the release
echo "Deleting release with ID: $RELEASE_ID"
curl -s -X DELETE -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$REPO/releases/$RELEASE_ID"

# Check if assets are available
if [ "$(echo "$ASSETS_JSON" | jq -r '.[] | length')" -eq 0 ]; then
echo "No assets found for release ID: $RELEASE_ID"
exit 1
echo "Release deletion complete."
fi

# List all assets
echo "Assets for release ID $RELEASE_ID:"
echo "$ASSETS_JSON" | jq -r '.[] | "\(.id): \(.name)"'

# Extract asset ID(s) of the asset with the same name
ASSET_IDS=$(echo "$ASSETS_JSON" | jq -r ".[] | select(.name == \"$ASSET_NAME\") | .id")

if [ -z "$ASSET_IDS" ]; then
echo "No asset found with name: $ASSET_NAME"
else
# Delete the existing asset(s)
for ASSET_ID in $ASSET_IDS; do
echo "Deleting existing asset with ID: $ASSET_ID"
curl -s -X DELETE -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$REPO/releases/assets/$ASSET_ID"
done
fi
# echo "Found release ID: $RELEASE_ID"

# # Fetch all assets for the release
# ASSET_URL="https://api.github.com/repos/$REPO/releases/$RELEASE_ID/assets"
# ASSETS_JSON=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "$ASSET_URL")

# # Check if assets are available
# if [ "$(echo "$ASSETS_JSON" | jq -r '.[] | length')" -eq 0 ]; then
# echo "No assets found for release ID: $RELEASE_ID"
# exit 1
# fi

# # List all assets
# echo "Assets for release ID $RELEASE_ID:"
# echo "$ASSETS_JSON" | jq -r '.[] | "\(.id): \(.name)"'

# # Extract asset ID(s) of the asset with the same name
# ASSET_IDS=$(echo "$ASSETS_JSON" | jq -r ".[] | select(.name == \"$ASSET_NAME\") | .id")

# if [ -z "$ASSET_IDS" ]; then
# echo "No asset found with name: $ASSET_NAME"
# else
# # Delete the existing asset(s)
# for ASSET_ID in $ASSET_IDS; do
# echo "Deleting existing asset with ID: $ASSET_ID"
# curl -s -X DELETE -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$REPO/releases/assets/$ASSET_ID"
# done
# fi

echo "Asset delete process complete."

Expand Down

0 comments on commit 50a406e

Please sign in to comment.