Skip to content

Commit 9309c7f

Browse files
mmacphersonclaude
andcommitted
ci: publish search DB as GitHub release artifact on package release
- publish.yml creates a `search-v{lucide_version}` release with the search DB attached, matching the URL template in config.py - update-lucide.yml now also commits the descriptions JSONL - Makefile build-search target passes --icons-db and --clusters-file Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 23a6efa commit 9309c7f

3 files changed

Lines changed: 31 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,27 @@ jobs:
4646
files: |
4747
dist/*.tar.gz
4848
dist/*.whl
49+
50+
- name: Publish search database to GitHub Release
51+
if: github.event_name == 'release'
52+
env:
53+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
run: |
55+
SEARCH_DB=src/lucide/data/lucide-search.db
56+
if [ ! -f "$SEARCH_DB" ]; then
57+
echo "⚠️ Search database not found, skipping"
58+
exit 0
59+
fi
60+
61+
LUCIDE_VERSION=$(sqlite3 "$SEARCH_DB" "SELECT value FROM metadata WHERE key='version';")
62+
RELEASE_TAG="search-v${LUCIDE_VERSION}"
63+
echo "Publishing search DB for Lucide v${LUCIDE_VERSION} → ${RELEASE_TAG}"
64+
65+
# Create the search-data release if it doesn't already exist
66+
gh release view "$RELEASE_TAG" >/dev/null 2>&1 || \
67+
gh release create "$RELEASE_TAG" \
68+
--title "Search data for Lucide v${LUCIDE_VERSION}" \
69+
--notes "Pre-built semantic search database for Lucide icons v${LUCIDE_VERSION}. Downloaded automatically by \`python-lucide[search]\` on first use."
70+
71+
gh release upload "$RELEASE_TAG" "$SEARCH_DB" --clobber
72+
echo "✅ Uploaded search DB to release ${RELEASE_TAG}"

.github/workflows/update-lucide.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ jobs:
161161
git config --local user.name "github-actions[bot]"
162162
163163
git add src/lucide/config.py src/lucide/data/lucide-icons.db pyproject.toml .github/lucide-version.json
164-
# Include search DB if it was generated
165-
if [ -f src/lucide/data/lucide-search.db ]; then
166-
git add src/lucide/data/lucide-search.db
167-
fi
164+
# Include search artifacts if they were generated
165+
for f in src/lucide/data/lucide-search.db src/lucide/data/gemini-icon-descriptions.jsonl; do
166+
[ -f "$f" ] && git add "$f"
167+
done
168168
git commit -m "feat: Update Lucide icons to v${{ steps.version-check.outputs.latest-version }}
169169
170170
Bumps package version to ${{ steps.version-bump.outputs.new-pkg-version }}.

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ describe:
6565
@echo "Generating icon descriptions..."
6666
$(LUCIDE_CMD) describe --icons-db $(DB_OUTPUT_PATH) -o $(DESCRIPTIONS_JSONL) -v
6767

68+
CLUSTERS_JSON := src/lucide/data/lucide-icon-clusters.json
69+
6870
build-search:
6971
@echo "Building search DB from descriptions..."
70-
$(LUCIDE_CMD) build-search --descriptions-file $(DESCRIPTIONS_JSONL) -o $(SEARCH_DB_OUTPUT_PATH) -v
72+
$(LUCIDE_CMD) build-search --descriptions-file $(DESCRIPTIONS_JSONL) --clusters-file $(CLUSTERS_JSON) --icons-db $(DB_OUTPUT_PATH) -o $(SEARCH_DB_OUTPUT_PATH) -v
7173

7274
search-data: describe build-search
7375

0 commit comments

Comments
 (0)