@@ -111,3 +111,100 @@ If you fork the repository, you must enable GitHub Actions for your fork and add
111111Set the ` WOKWI_CLI_TOKEN ` secret in your fork under ` Settings ` > ` Secrets and variables ` > ` Actions ` > ` New repository secret ` .
112112
113113Instructions for obtaining the ` WOKWI_CLI_TOKEN ` are in the ` README.md ` (see the Usage section).
114+
115+
116+ ## Deployment
117+
118+ Packages are published manually using ` pnpm ` tools. Before publishing, ensure you have:
119+ - Updated the version number in the package's ` package.json `
120+ - Committed all changes
121+ - Built and tested the packages
122+
123+ ### Publishing wokwi-cli
124+
125+ The ` wokwi-cli ` package includes binary executables for multiple platforms. To publish:
126+
127+ 1 . Navigate to the package directory:
128+ ``` bash
129+ cd packages/wokwi-cli
130+ ```
131+
132+ 2 . Clean previous builds:
133+ ``` bash
134+ pnpm clean
135+ ```
136+
137+ 3 . Build the package:
138+ ``` bash
139+ pnpm build
140+ ```
141+
142+ 4 . Package binaries for all platforms (optional, for verification):
143+ This is used only in CI to produce platform-specific binaries, those are not published to npm.
144+ ``` bash
145+ pnpm package
146+ ```
147+ This creates platform-specific binaries in ` dist/bin/ ` using ` pkg ` .
148+
149+ 5 . Create the tarball (optional, for verification):
150+ ``` bash
151+ pnpm pack
152+ ```
153+
154+ 6 . Publish to npm:
155+ ``` bash
156+ pnpm publish
157+ ```
158+
159+ ### Publishing wokwi-client-js
160+
161+ The ` wokwi-client-js ` package is a JavaScript library without binaries. To publish:
162+
163+ 1 . Navigate to the package directory:
164+ ``` bash
165+ cd packages/wokwi-client-js
166+ ```
167+
168+ 2 . Clean previous builds:
169+ ``` bash
170+ pnpm clean
171+ ```
172+
173+ 3 . Build the package:
174+ ``` bash
175+ pnpm build
176+ ```
177+
178+ 4 . Create the tarball (optional, for verification):
179+ ``` bash
180+ pnpm pack
181+ ```
182+
183+ 5 . Publish to npm:
184+ ``` bash
185+ pnpm publish
186+ ```
187+
188+ ### Publishing both packages
189+
190+ To publish both packages in sequence:
191+
192+ ``` bash
193+ # Publish wokwi-client-js first (it's a dependency of wokwi-cli)
194+ cd packages/wokwi-client-js
195+ pnpm clean && pnpm build && pnpm publish
196+
197+ # Then publish wokwi-cli
198+ cd ../wokwi-cli
199+ pnpm clean && pnpm build && pnpm publish
200+ ```
201+
202+ ### Test GitHub Actions publishing (optional)
203+ GitHub Actions are set up to publish CLI tool compiled for multiple platforms. To test the publishing commands locally, you can run:
204+
205+ ``` bash
206+ pnpm run build && pnpm --filter wokwi-cli run package
207+ ```
208+
209+ It should produce the platform-specific binaries in ` packages/wokwi-cli/dist/bin/ ` .
210+
0 commit comments