This guide documents the supported build flows and the reproducible release artifact produced by WebSSH2.
Use the standard npm scripts when iterating locally:
npm ci
npm run dev
npm run buildThese commands operate directly on the TypeScript sources in the repository and mirror the behaviour of the previous tooling.
Releases publish a tarball that contains only the files required to run WebSSH2 in production:
- Install dependencies without development packages.
npm ci --omit=dev
- Compile the TypeScript project.
npm run build
- Package the reproducible artifact.
node dist/scripts/create-release-artifact.js
Release tags are generated by release-please and use the
webssh2-server-v<version> naming convention.
Note: If you install dependencies with
--ignore-scripts, runnpm run prepare:runtimebefore packaging to ensure optional native modules are installed when needed.
The packaging script requires GNU tar on the system PATH. The script stages the
following files in a deterministic archive:
dist/– compiled JavaScript and type definitionspackage.jsonandpackage-lock.jsonscripts/postinstall.jsandscripts/prestart.jsmanifest.json– metadata about the build
The script writes the outputs to release-artifacts/ (override with
RELEASE_ARTIFACT_DIR). It also emits a SHA-256 checksum file alongside the tarball.
manifest.json contains:
{
"version": "x.y.z",
"gitSha": "<full commit sha>",
"buildTime": "<ISO 8601 timestamp>",
"distSha256": "<sha256 of staged dist/>"
}Use the manifest together with the .sha256 checksum to verify the artifact before deploying.
To test a packaged release locally:
tar -xzf webssh2-<version>.tar.gz -C ./test-release
cd ./test-release
npm ci --omit=dev
NODE_ENV=production npm startThe prestart script detects that tsconfig.build.json is absent and skips
rebuilding, launching the compiled server from dist/index.js.
- GNU tar available on the runner (
tar --versionprints "GNU tar") npm ci --omit=devsucceeds before buildingnode dist/scripts/create-release-artifact.jsruns after compilation- Upload both the tarball and its
.sha256file to the release