Skip to content

Commit 14cc7a7

Browse files
committed
Document and finalize release binary flow
1 parent 383c7c3 commit 14cc7a7

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,18 @@ simulateTransaction({ instructions, payer, rpc, options? })
174174
## License
175175

176176
MIT
177+
178+
## Release Flow
179+
180+
1. Configure repo secret `NPM_TOKEN` in GitHub Actions (use an npm automation token).
181+
2. Cut a release from local once your branch is ready:
182+
- `bun run release:cut patch`
183+
- or `bun run release:cut minor`
184+
- or `bun run release:cut major`
185+
- or explicit: `bun run release:cut 0.2.1`
186+
3. The script runs `bun run ci`, bumps `package.json`, commits, tags, and pushes.
187+
4. Tag push (`vX.Y.Z`) triggers `.github/workflows/release.yml`:
188+
- runs CI
189+
- builds a Bun Linux binary (`dist/bin/pump-kit`)
190+
- uploads release assets (`pump-kit-linux-x64`, `.sha256`, `.tar.gz`)
191+
- publishes npm package.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"lint": "oxlint --deny-warnings src tests scripts examples",
2828
"lint:fix": "oxlint --fix --deny-warnings src tests scripts examples",
2929
"build:js": "bun build ./src/index.ts --outdir dist --format esm --minify",
30-
"build:binary": "mkdir -p dist/bin && bun build --compile --outfile dist/bin/pump-kit ./src/bin/pump-kit.ts",
30+
"build:binary": "mkdir -p dist/bin && PUMP_KIT_VERSION=$(node -p \"require('./package.json').version\") bun build --compile --env='PUMP_KIT_*' --outfile dist/bin/pump-kit ./src/bin/pump-kit.ts",
3131
"build:types": "tsc -p tsconfig.build.json",
3232
"build": "rm -rf dist && bun run build:js && bun run build:types",
3333
"ci": "bun run dev:typecheck && bun run lint && bun run test:unit && bun run test:integration && bun run build",

src/bin/pump-kit.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import { readFileSync } from "node:fs";
44

55
function readVersion(): string {
6+
const fromEnv = process.env.PUMP_KIT_VERSION;
7+
if (fromEnv && fromEnv.length > 0) {
8+
return fromEnv;
9+
}
10+
611
try {
712
const pkgUrl = new URL("../../package.json", import.meta.url);
813
const pkg = JSON.parse(readFileSync(pkgUrl, "utf8")) as { version?: string };

0 commit comments

Comments
 (0)