|
| 1 | +# Publishing and No-Clone Distribution |
| 2 | + |
| 3 | +This guide explains how users can install Spatiad artifacts without cloning this repository. |
| 4 | + |
| 5 | +## 1) Publish TypeScript SDK to npm |
| 6 | + |
| 7 | +Users can then install with npm, pnpm, or yarn. |
| 8 | + |
| 9 | +### One-time setup |
| 10 | + |
| 11 | +```bash |
| 12 | +npm login |
| 13 | +``` |
| 14 | + |
| 15 | +### Release flow |
| 16 | + |
| 17 | +```bash |
| 18 | +cd typescript |
| 19 | +pnpm install --frozen-lockfile |
| 20 | +pnpm --filter @spatiad/sdk build |
| 21 | +pnpm --filter @spatiad/sdk test |
| 22 | +pnpm --filter @spatiad/sdk publish --no-git-checks --access public |
| 23 | +``` |
| 24 | + |
| 25 | +### GitHub Actions option |
| 26 | + |
| 27 | +Use `.github/workflows/publish-sdk.yml` with `workflow_dispatch` and a release tag. |
| 28 | + |
| 29 | +Required secret: |
| 30 | + |
| 31 | +- `NPM_TOKEN`: npm automation token with publish permission for `@spatiad/sdk` |
| 32 | + |
| 33 | +After publish, end users install with: |
| 34 | + |
| 35 | +```bash |
| 36 | +npm i @spatiad/sdk |
| 37 | +# or |
| 38 | +pnpm add @spatiad/sdk |
| 39 | +``` |
| 40 | + |
| 41 | +## 2) Publish container image |
| 42 | + |
| 43 | +Container users do not need source code. |
| 44 | + |
| 45 | +Example (GHCR): |
| 46 | + |
| 47 | +```bash |
| 48 | +docker build -t ghcr.io/<owner>/spatiad:latest -f Dockerfile . |
| 49 | +docker push ghcr.io/<owner>/spatiad:latest |
| 50 | +``` |
| 51 | + |
| 52 | +Consumers run with: |
| 53 | + |
| 54 | +```bash |
| 55 | +docker run -p 3000:3000 ghcr.io/<owner>/spatiad:latest |
| 56 | +``` |
| 57 | + |
| 58 | +## 3) Publish binary assets and support one-command install |
| 59 | + |
| 60 | +Build and upload release archives to GitHub Releases with this naming pattern: |
| 61 | + |
| 62 | +- spatiad-vX.Y.Z-linux-x86_64.tar.gz |
| 63 | +- spatiad-vX.Y.Z-linux-aarch64.tar.gz |
| 64 | +- spatiad-vX.Y.Z-darwin-x86_64.tar.gz |
| 65 | +- spatiad-vX.Y.Z-darwin-aarch64.tar.gz |
| 66 | + |
| 67 | +Each archive should contain: |
| 68 | + |
| 69 | +- spatiad-bin |
| 70 | + |
| 71 | +Users can install via: |
| 72 | + |
| 73 | +```bash |
| 74 | +curl -fsSL https://raw.githubusercontent.com/<owner>/spatiad/main/dist/install-spatiad.sh | sh -s -- v0.1.0 |
| 75 | +``` |
| 76 | + |
| 77 | +Or with explicit install dir: |
| 78 | + |
| 79 | +```bash |
| 80 | +curl -fsSL https://raw.githubusercontent.com/<owner>/spatiad/main/dist/install-spatiad.sh | sh -s -- v0.1.0 /usr/local/bin |
| 81 | +``` |
| 82 | + |
| 83 | +## npm vs pnpm |
| 84 | + |
| 85 | +- Publishing target is npm registry. |
| 86 | +- End users may use npm, pnpm, or yarn. |
| 87 | +- pnpm is a package manager choice, not a separate distribution channel. |
0 commit comments