Repository navigation
chore: rebuild devnet catalog #137
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: Sync Warp Catalog | |
| on: | |
| push: | |
| branches: ["dev", "main"] | |
| paths: | |
| - 'warps/**' | |
| - 'scripts/catalog/**' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| workflow_dispatch: | |
| inputs: | |
| full_sync: | |
| description: 'Run full sync (ignore previous manifest baseline)' | |
| required: false | |
| default: false | |
| type: boolean | |
| concurrency: | |
| group: warp-sync-${{ github.ref_name }} | |
| cancel-in-progress: false | |
| jobs: | |
| sync-catalog: | |
| if: github.actor != 'github-actions[bot]' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build catalog | |
| run: | | |
| FULL_FLAG="" | |
| if [ "${{ github.event.inputs.full_sync }}" = "true" ]; then | |
| FULL_FLAG="--full" | |
| fi | |
| node --import tsx scripts/catalog/build-catalog.ts $FULL_FLAG --branch "${GITHUB_REF_NAME}" --commit "${GITHUB_SHA}" --repo "${GITHUB_REPOSITORY}" | |
| - name: Commit catalog changes | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add catalog | |
| git diff --quiet && git diff --staged --quiet || (git commit -m "chore: update warp catalog [skip ci]" && git pull --rebase && git push) | |
| - name: Sync delta to API | |
| env: | |
| WARP_GITHUB_SYNC_TOKEN: ${{ secrets.WARP_GITHUB_SYNC_TOKEN }} | |
| run: node --import tsx scripts/catalog/sync-to-api.ts --branch "${GITHUB_REF_NAME}" --commit "${GITHUB_SHA}" --repo "${GITHUB_REPOSITORY}" | |
| - name: Dispatch plugin sync | |
| env: | |
| JOAI_PLUGIN_SYNC_TOKEN: ${{ secrets.JOAI_PLUGIN_SYNC_TOKEN }} | |
| if: ${{ env.JOAI_PLUGIN_SYNC_TOKEN != '' }} | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ env.JOAI_PLUGIN_SYNC_TOKEN }} | |
| repository: JoAiHQ/plugins | |
| event-type: warps_catalog_updated | |
| client-payload: >- | |
| {"warps_ref":"${{ github.ref_name }}","warps_sha":"${{ github.sha }}"} |