chore: auto-publish protocol and cli packages on push to main #1
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
| # Publish @indexnetwork/cli to npm on every push to main. | |
| # Reads version from package.json — npm silently skips if already published. | |
| # | |
| # Requires: GitHub repo secret INDEX_REPO_TOKEN (npm automation token). | |
| name: Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: publish-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| name: Build and publish to npm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build | |
| run: bun run build | |
| - name: Publish (skip if version already exists) | |
| run: npm publish --access public || true | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.INDEX_REPO_TOKEN }} |