Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/release-binaries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release Binaries
on:
push:
tags:
- v*
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '26'
cache: npm
- run: npm ci
- run: scripts/build-sea.sh
- name: Smoke-test the native binary
run: |
expected="$(node -p 'require("./package.json").version')"
tar -xzf "dist-bin/sdfz-demo-parser-$expected-linux-x64.tar.gz" -C /tmp
bin=/tmp/sdfz-demo-parser
got="$("$bin" --version)"
if [[ "$got" != "$expected" ]]; then
echo "error: binary reported version '$got', expected '$expected'" >&2
exit 1
fi
"$bin" "test/test_replays/2025-08-08_10-25-43-160_Supreme Isthmus v2_2025.04.08.sdfz" --header-only > /dev/null
echo "Smoke test passed (version $got, parsed a demo)"
- uses: softprops/action-gh-release@v2
with:
files: dist-bin/*
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
dist
node_modules
/working-files
debug.log
debug.log
/build
/dist-bin
/nodes
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import { DemoParser } from "sdfz-demo-parser";

## CLI

The package also ships a CLI (requires Node.js 24+) that parses a demo file and prints the result as JSON.
The package also ships a CLI that parses a demo file and prints the result as JSON. You can use it from npm, or download a standalone executable that needs no Node.js installation.

### From npm (requires Node.js 24+)

Run it without installing:

Expand All @@ -37,7 +39,18 @@ npm i -g sdfz-demo-parser
sdfz-demo-parser <demo.sdfz> > demo.json
```

Examples:
### Standalone executable (no Node.js required)

Every release ships self-contained executables with Node.js bundled in, for Linux and Windows (x64 and arm64). Download the archive for your platform from the [latest GitHub release](../../releases/latest) — `.tar.gz` for Linux, `.zip` for Windows — and extract the `sdfz-demo-parser` binary:

```
tar -xzf sdfz-demo-parser-*-linux-x64.tar.gz
./sdfz-demo-parser game.sdfz > demo.json
```

The binaries are unsigned, so Windows SmartScreen may warn on first run. They accept exactly the same options as the npm CLI.

### Examples

```
# Full parse, pretty JSON to stdout (the packet stream is included by default)
Expand All @@ -61,3 +74,5 @@ sdfz-demo-parser game.sdfz --exclude-packets "" --compact
npm version --sign-git-tag patch|minor|major
git push --follow-tags
```

Pushing the version tag publishes the package to npm and builds the standalone executables, attaching them to the GitHub release for the tag.
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineConfig, globalIgnores } from "eslint/config";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import unusedImports from "eslint-plugin-unused-imports";

export default defineConfig([globalIgnores(["**/dist", "**/working-files"]), {
export default defineConfig([globalIgnores(["**/dist", "**/working-files", "**/build", "**/dist-bin", "**/nodes"]), {
plugins: {
"@typescript-eslint": typescriptEslint,
"simple-import-sort": simpleImportSort,
Expand Down
Loading