Skip to content

Commit 8b1d269

Browse files
committed
chore: auto-publish protocol and cli packages on push to main
1 parent 84b61b6 commit 8b1d269

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Publish @indexnetwork/cli to npm on every push to main.
2+
# Reads version from package.json — npm silently skips if already published.
3+
#
4+
# Requires: GitHub repo secret INDEX_REPO_TOKEN (npm automation token).
5+
name: Publish
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
concurrency:
13+
group: publish-${{ github.ref }}
14+
cancel-in-progress: false
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
name: Build and publish to npm
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: oven-sh/setup-bun@v2
25+
with:
26+
bun-version: latest
27+
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: 24
31+
registry-url: https://registry.npmjs.org
32+
33+
- name: Install dependencies
34+
run: bun install --frozen-lockfile
35+
36+
- name: Build
37+
run: bun run build
38+
39+
- name: Publish (skip if version already exists)
40+
run: npm publish --access public || true
41+
env:
42+
NODE_AUTH_TOKEN: ${{ secrets.INDEX_REPO_TOKEN }}

0 commit comments

Comments
 (0)