Skip to content

Commit 540d12e

Browse files
committed
remove deprecated packages
1 parent f93ace8 commit 540d12e

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/build-and-push-tutorial-agent.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
needs: [check-permissions]
5757
outputs:
5858
agents: ${{ steps.get-agents.outputs.agents }}
59+
all_agents: ${{ steps.get-agents.outputs.all_agents }}
5960
has_agents: ${{ steps.get-agents.outputs.has_agents }}
6061
steps:
6162
- name: Checkout repository
@@ -72,6 +73,10 @@ jobs:
7273
all_agents=$(find examples/tutorials -name "manifest.yaml" -exec dirname {} \; | sort)
7374
agents_to_build=()
7475
76+
# Output all agents for deprecation check
77+
all_agents_json=$(printf '%s\n' $all_agents | jq -R -s -c 'split("\n") | map(select(length > 0))')
78+
echo "all_agents=$all_agents_json" >> $GITHUB_OUTPUT
79+
7580
if [ "$REBUILD_ALL" = "true" ]; then
7681
echo "Rebuild all agents requested"
7782
agents_to_build=($(echo "$all_agents"))
@@ -199,3 +204,59 @@ jobs:
199204
agentex agents build $BUILD_ARGS
200205
echo "✅ Build validation successful for: ${{ matrix.agent_path }}"
201206
fi
207+
208+
deprecate-agents:
209+
name: "Deprecate Removed Agents"
210+
runs-on: ubuntu-latest
211+
needs: [find-agents]
212+
steps:
213+
- name: Find and delete deprecated agent packages
214+
env:
215+
GITHUB_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
216+
run: |
217+
set -e
218+
219+
echo "🔍 Agents in repo (from find-agents):"
220+
# Convert JSON array of paths to package names
221+
# e.g., "examples/tutorials/00_sync/000_hello_acp" -> "00_sync-000_hello_acp"
222+
REPO_AGENTS=$(echo '${{ needs.find-agents.outputs.all_agents }}' | jq -r '.[]' | \
223+
sed 's|examples/tutorials/||' | \
224+
sed 's|/|-|g')
225+
echo "$REPO_AGENTS"
226+
227+
echo ""
228+
echo "🔍 Fetching packages from GitHub Container Registry..."
229+
PACKAGES=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
230+
-H "Accept: application/vnd.github+json" \
231+
"https://api.github.com/orgs/scaleapi/packages?package_type=container&per_page=100")
232+
233+
# Filter for tutorial-agents from this repo
234+
TUTORIAL_PACKAGES=$(echo "$PACKAGES" | \
235+
jq -r '.[] | select(.repository.name == "scale-agentex-python" and (.name | contains("tutorial-agents"))) | .name')
236+
237+
echo "Tutorial packages in registry:"
238+
echo "$TUTORIAL_PACKAGES"
239+
240+
#
241+
# echo ""
242+
# echo "🔍 Checking for deprecated packages..."
243+
# while IFS= read -r package_name; do
244+
# [ -z "$package_name" ] && continue
245+
#
246+
# # Extract agent name: scale-agentex-python/tutorial-agents/00_sync-000_hello_acp -> 00_sync-000_hello_acp
247+
# agent_name=$(echo "$package_name" | sed 's|.*/tutorial-agents/||')
248+
#
249+
# if echo "$REPO_AGENTS" | grep -q "^${agent_name}$"; then
250+
# echo "✅ $agent_name - still in repo"
251+
# else
252+
# echo "🗑️ $agent_name - NOT in repo, deleting..."
253+
# curl -s -X DELETE \
254+
# -H "Authorization: Bearer $GITHUB_TOKEN" \
255+
# -H "Accept: application/vnd.github+json" \
256+
# "https://api.github.com/orgs/scaleapi/packages/container/$(echo "$package_name" | sed 's|/|%2F|g')"
257+
# echo " Deleted: $package_name"
258+
# fi
259+
# done <<< "$TUTORIAL_PACKAGES"
260+
261+
echo ""
262+
echo "✅ Deprecation check complete"

0 commit comments

Comments
 (0)