Build Index #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Index | |
| on: | |
| schedule: | |
| # Every day at 6am UTC | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build index builder | |
| run: cargo build --release --bin build_index | |
| - name: Download previous index for stars cache | |
| run: | | |
| curl -fsSL -o prev_index.yaml \ | |
| https://github.com/${{ github.repository }}/releases/download/index/index.yaml \ | |
| 2>/dev/null || echo "No previous index found, building from scratch" | |
| - name: Build index | |
| run: | | |
| if [ -f prev_index.yaml ]; then | |
| ./target/release/build_index index.yaml prev_index.yaml | |
| else | |
| ./target/release/build_index index.yaml | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_LIMIT: 5000 | |
| CRATES_LIMIT: 1000 | |
| NPM_LIMIT: 500 | |
| LLMS_LIMIT: 500 | |
| TOOLLEEO_LIMIT: 500 | |
| - name: Upload index as release asset | |
| run: | | |
| # Delete existing release if it exists (ignore errors) | |
| gh release delete index --yes --cleanup-tag 2>/dev/null || true | |
| sleep 2 | |
| # Create new release with index file | |
| gh release create index \ | |
| --title "Latest Index" \ | |
| --notes "Auto-generated CLI tool index. Updated daily." \ | |
| --latest=false \ | |
| index.yaml | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} |