Skip to content

chore: auto-publish protocol and cli packages on push to main #1

chore: auto-publish protocol and cli packages on push to main

chore: auto-publish protocol and cli packages on push to main #1

Workflow file for this run

# 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 }}