11---
22name : publish-cli
33description : >
4- CLI publishing workflow for npm releases via GitHub Actions .
4+ CLI publishing workflow using GitHub releases for binaries and local npm publish .
55 Trigger terms: publish, release, npm, cli, version, tag, github actions,
6- vibetracking-core , package, deploy cli.
6+ vibetracking, package, deploy cli.
77---
88
99## When to Use
1010
1111- Publishing a new version of the CLI to npm
12- - Checking which packages are published
13- - Understanding the release workflow
14-
15- ## Published Packages
16-
17- | Package | Description |
18- | ---------| -------------|
19- | ` vibetracking ` | Main CLI package |
20- | ` @starknetid/vibetracking-core ` | Native Rust core (auto-selects platform) |
21- | ` @starknetid/vibetracking-core-darwin-x64 ` | macOS Intel |
22- | ` @starknetid/vibetracking-core-darwin-arm64 ` | macOS Apple Silicon |
23- | ` @starknetid/vibetracking-core-darwin-universal ` | macOS Universal |
24- | ` @starknetid/vibetracking-core-linux-x64-gnu ` | Linux x64 (glibc) |
25- | ` @starknetid/vibetracking-core-linux-arm64-gnu ` | Linux ARM64 (glibc) |
26- | ` @starknetid/vibetracking-core-win32-x64-msvc ` | Windows x64 |
27- | ` @starknetid/vibetracking-core-win32-arm64-msvc ` | Windows ARM64 |
12+ - Checking the release workflow
13+ - Understanding the hybrid publishing model
14+
15+ ## Architecture: Hybrid Publishing
16+
17+ The CLI uses a hybrid publishing approach:
18+
19+ | Component | Host | Description |
20+ | -----------| ------| -------------|
21+ | ` vibetracking ` | npm | CLI JavaScript wrapper (you publish locally) |
22+ | Native binaries | GitHub Releases | ` .node ` files for each platform |
23+
24+ ** Why?** This simplifies publishing to 1 npm package instead of 9, avoiding npm OIDC/auth issues.
25+
26+ ** How it works** : On first run, the CLI downloads the correct native binary from GitHub releases to ` ~/.vibetracking/bin/{version}/ ` .
2827
2928## Procedure: Publish a New Version
3029
3130### Step 1: Update Version Numbers
3231
33- Update versions in ** both** package.json files:
34- - ` packages/cli/package.json `
35- - ` packages/core/package.json `
32+ Update version in ` packages/cli/package.json ` :
33+ ``` json
34+ {
35+ "version" : " X.Y.Z"
36+ }
37+ ```
38+
39+ Update ` BINARY_VERSION ` constant in:
40+ - ` packages/cli/src/native.ts `
41+ - ` packages/cli/src/native-runner.ts `
3642
37- Also update ` optionalDependencies ` versions in core's package.json.
43+ ``` typescript
44+ const BINARY_VERSION = " X.Y.Z" ;
45+ ```
3846
3947### Step 2: Commit and Push
4048
4149``` bash
42- git add packages/cli/package.json packages/core/package.json
50+ git add packages/cli/
4351git commit -m " chore: bump CLI version to X.Y.Z"
4452git push origin main
4553```
@@ -51,57 +59,66 @@ git tag cli-vX.Y.Z
5159git push origin cli-vX.Y.Z
5260```
5361
54- ### Step 4: Verify Release
62+ ### Step 4: Wait for CI
5563
56- GitHub Actions will automatically :
64+ GitHub Actions will:
57651 . Build native binaries for all 6 platforms
58662 . Create universal macOS binary
59- 3 . Publish ` @starknetid/vibetracking-core ` and all platform packages
60- 4 . Publish ` vibetracking ` CLI
67+ 3 . Upload all binaries to GitHub Release
6168
6269Monitor progress at: Actions > Release CLI
6370
71+ ### Step 5: Publish CLI to npm (Locally)
72+
73+ Once CI completes, publish from your local machine:
74+
75+ ``` bash
76+ cd packages/cli
77+ pnpm build
78+ npm publish --access public
79+ ```
80+
81+ ### Step 6: Verify
82+
83+ ``` bash
84+ # Check npm
85+ npm view vibetracking versions
86+
87+ # Test fresh install (should download binary)
88+ rm -rf ~ /.vibetracking/bin
89+ bunx vibetracking@X.Y.Z --version
90+ ```
91+
6492## Workflow Configuration
6593
6694- ** File** : ` .github/workflows/release.yml `
6795- ** Trigger** : Push tags matching ` cli-v* `
68- - ** Authentication** : OIDC Trusted Publishing (no tokens required)
69-
70- ### Setting Up Trusted Publishers
71-
72- Each package must be configured on npmjs.com to trust this workflow:
73-
74- 1 . Go to ` https://www.npmjs.com/package/<package-name>/access `
75- 2 . Scroll to ** "Trusted Publisher"** section
76- 3 . Click ** "GitHub Actions"**
77- 4 . Configure:
78- - ** Organization/User** : ` lfglabs-dev `
79- - ** Repository** : ` louisville `
80- - ** Workflow filename** : ` release.yml `
81- - ** Environment** : * (leave blank)*
82-
83- Packages requiring trusted publisher setup:
84- - ` vibetracking `
85- - ` @starknetid/vibetracking-core `
86- - ` @starknetid/vibetracking-core-darwin-x64 `
87- - ` @starknetid/vibetracking-core-darwin-arm64 `
88- - ` @starknetid/vibetracking-core-darwin-universal `
89- - ` @starknetid/vibetracking-core-linux-x64-gnu `
90- - ` @starknetid/vibetracking-core-linux-arm64-gnu `
91- - ` @starknetid/vibetracking-core-win32-x64-msvc `
92- - ` @starknetid/vibetracking-core-win32-arm64-msvc `
93-
94- ## Manual Trigger (Dry Run)
95-
96- Test the workflow without publishing:
96+ - ** Output** : Native binaries uploaded to GitHub Release
97+
98+ ### Manual Trigger (Dry Run)
99+
100+ Test the build without uploading:
971011 . Go to Actions > Release CLI
981022 . Click "Run workflow"
991033 . Check "Dry run" option
100104
105+ ## Native Binary Locations
106+
107+ Binaries are downloaded to ` ~/.vibetracking/bin/{version}/ ` :
108+
109+ | Platform | Binary Name |
110+ | ----------| -------------|
111+ | macOS Intel | ` vibetracking-core.darwin-x64.node ` |
112+ | macOS ARM | ` vibetracking-core.darwin-arm64.node ` |
113+ | Linux x64 | ` vibetracking-core.linux-x64-gnu.node ` |
114+ | Linux ARM64 | ` vibetracking-core.linux-arm64-gnu.node ` |
115+ | Windows x64 | ` vibetracking-core.win32-x64-msvc.node ` |
116+ | Windows ARM64 | ` vibetracking-core.win32-arm64-msvc.node ` |
117+
101118## User Installation
102119
103120After publishing, users can install with:
104121``` bash
105- bunx vibetracking # One-off execution
122+ bunx vibetracking # One-off execution (downloads binary on first run)
106123bun add -g vibetracking # Global install
107124```
0 commit comments