@@ -53,24 +53,48 @@ jobs:
5353 }
5454 chmod +x /usr/local/bin/soarql
5555
56+ - name : Filter recipes by pkg_type
57+ run : |
58+ mkdir -p /tmp/bincache-recipes /tmp/pkgcache-recipes /tmp/output
59+
60+ # Find all recipes and filter by pkg_type
61+ for recipe in $(find binaries packages -name "*.yaml" -type f 2>/dev/null); do
62+ pkg_type=$(grep -E "^pkg_type:" "$recipe" | head -1 | sed 's/pkg_type:[[:space:]]*//; s/^["'"'"']//; s/["'"'"']$//' || echo "")
63+
64+ # Create directory structure and copy recipe
65+ rel_path=$(dirname "$recipe")
66+ if [ "$pkg_type" = "static" ] || [ "$pkg_type" = "dynamic" ]; then
67+ mkdir -p "/tmp/bincache-recipes/$rel_path"
68+ cp "$recipe" "/tmp/bincache-recipes/$recipe"
69+ else
70+ mkdir -p "/tmp/pkgcache-recipes/$rel_path"
71+ cp "$recipe" "/tmp/pkgcache-recipes/$recipe"
72+ fi
73+ done
74+
75+ echo "=== Bincache recipes (static/dynamic) ==="
76+ find /tmp/bincache-recipes -name "*.yaml" 2>/dev/null | wc -l
77+
78+ echo "=== Pkgcache recipes (other pkg_types) ==="
79+ find /tmp/pkgcache-recipes -name "*.yaml" 2>/dev/null | wc -l
80+
5681 - name : Generate bincache metadata
5782 env :
5883 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5984 run : |
60- mkdir -p /tmp/output
61-
62- # Note: For test repo, the packages are pushed to bincache-test
63- # sbuild-meta will look for ghcr.io/pkgforge/bincache-test/<pkg>
64- sbuild-meta generate \
65- --arch "${{ matrix.arch }}" \
66- --recipes ./binaries \
67- --output /tmp/output \
68- --cache-type bincache \
69- --parallel 4 \
70- --ghcr-owner pkgforge-dev \
71- --github-token "$GITHUB_TOKEN" || {
72- echo "::warning::bincache metadata generation failed or no packages found"
73- }
85+ # Generate metadata for static/dynamic packages (bincache)
86+ if [ -n "$(find /tmp/bincache-recipes -name '*.yaml' 2>/dev/null)" ]; then
87+ sbuild-meta generate \
88+ --arch "${{ matrix.arch }}" \
89+ --recipes /tmp/bincache-recipes \
90+ --output /tmp/output \
91+ --cache-type bincache \
92+ --parallel 4 \
93+ --ghcr-owner pkgforge-dev \
94+ --github-token "$GITHUB_TOKEN" || {
95+ echo "::warning::bincache metadata generation failed or no packages found"
96+ }
97+ fi
7498
7599 # Rename to include cache type
76100 if [ -f "/tmp/output/bincache/${{ matrix.arch }}.json" ]; then
@@ -85,16 +109,19 @@ jobs:
85109 env :
86110 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
87111 run : |
88- sbuild-meta generate \
89- --arch "${{ matrix.arch }}" \
90- --recipes ./packages \
91- --output /tmp/output \
92- --cache-type pkgcache \
93- --parallel 4 \
94- --ghcr-owner pkgforge-dev \
95- --github-token "$GITHUB_TOKEN" || {
96- echo "::warning::pkgcache metadata generation failed or no packages found"
97- }
112+ # Generate metadata for non-static/dynamic packages (pkgcache)
113+ if [ -n "$(find /tmp/pkgcache-recipes -name '*.yaml' 2>/dev/null)" ]; then
114+ sbuild-meta generate \
115+ --arch "${{ matrix.arch }}" \
116+ --recipes /tmp/pkgcache-recipes \
117+ --output /tmp/output \
118+ --cache-type pkgcache \
119+ --parallel 4 \
120+ --ghcr-owner pkgforge-dev \
121+ --github-token "$GITHUB_TOKEN" || {
122+ echo "::warning::pkgcache metadata generation failed or no packages found"
123+ }
124+ fi
98125
99126 # Rename to include cache type
100127 if [ -f "/tmp/output/pkgcache/${{ matrix.arch }}.json" ]; then
0 commit comments