Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
12e0513
docs: add sample JER messages for J2735
yhseanhsu Jan 15, 2026
7c22e24
build: add .gitignore file
yhseanhsu Jan 15, 2026
258aea1
refactor: rename 202409 core folder to j2735_202409
yhseanhsu Jan 15, 2026
1650dbb
build: implement multi-target CMake and Makefile build system
yhseanhsu Jan 15, 2026
4c67913
build: implement python distribution pipeline and workspace
yhseanhsu Jan 15, 2026
5f3683f
feat: add node.js bindings and workspace orchestration
yhseanhsu Jan 16, 2026
76a7fae
build: add Makefile support for node bindings
yhseanhsu Jan 16, 2026
0d60ce0
docs: bump project version to 0.2.0
yhseanhsu Jan 16, 2026
117ab77
ci: initial draft of github action for project
yhseanhsu Jan 16, 2026
6a628ef
ci: fix minor workflow bugs
yhseanhsu Jan 16, 2026
06167e9
docs: add README to lanaugage bindings and root
yhseanhsu Jan 16, 2026
d07450a
feat: add protobuf encoding and decoding support for py bindings
yhseanhsu Jan 16, 2026
3d77949
feat: add protobuf header support for node bindings
yhseanhsu Jan 17, 2026
01c723b
ci: fix missing protobuf folder error
yhseanhsu Jan 17, 2026
127faa1
build: fix install-js build artifacts
yhseanhsu Jan 17, 2026
4c075ce
feat: add sample code for python
yhseanhsu Jan 18, 2026
ebcc9d2
feat: add sample code for node
yhseanhsu Jan 19, 2026
d07090e
fix: clean room test for python
yhseanhsu Jan 19, 2026
c3e107e
fix: improve Linux process management and CI stability
yhseanhsu Jan 19, 2026
0b03626
fix: configuration and cli arguments for examples
yhseanhsu Feb 3, 2026
5f3275d
refactor: build hierarchy for codec
yhseanhsu Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
247 changes: 247 additions & 0 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
name: Core CI & Release

on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]

jobs:
verify-version:
name: Verify Version Match
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
TAG_VERSION=${GITHUB_REF_NAME#v}
FILE_VERSION=$(cat VERSION)
if [[ "$TAG_VERSION" != "$FILE_VERSION"* ]]; then
echo "::error::Version Mismatch! Tag '$TAG_VERSION' vs VERSION '$FILE_VERSION'"
exit 1
fi

build-core:
name: Build WASM Core
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Emscripten
id: cache-emsdk
uses: actions/cache@v4
with:
path: emsdk
key: ${{ runner.os }}-emsdk-4.0.10
- name: Install Emscripten
if: steps.cache-emsdk.outputs.cache-hit != 'true'
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk && ./emsdk install 4.0.10 && ./emsdk activate 4.0.10
- name: Compile
run: |
source emsdk/emsdk_env.sh
cd j2735codec
make wasm
# Create __init__.py files
touch bindings/python/src/j2735codec/generated/__init__.py
touch bindings/python/src/j2735codec/protobuf/__init__.py

- name: Upload Python Artifacts
uses: actions/upload-artifact@v4
with:
name: python-wasm-binaries
# Use the parent directory to ensure the j2735codec folder structure is preserved
path: j2735codec/bindings/python/src/j2735codec/
include-hidden-files: true

- name: Upload Node Artifacts
uses: actions/upload-artifact@v4
with:
name: node-wasm-binaries
path: j2735codec/bindings/node/src/generated/

test-bindings:
name: Test ${{ matrix.binding }}
needs: build-core
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
binding: [python, node]
steps:
- uses: actions/checkout@v4

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.binding }}-wasm-binaries
path: j2735codec/bindings/${{ matrix.binding }}/${{ matrix.binding == 'python' && 'src/j2735codec/' || 'src/generated/' }}

- name: Repair and Verify Structure
run: |
if [ "${{ matrix.binding }}" == "python" ]; then
cd j2735codec/bindings/python/src/j2735codec
touch __init__.py generated/__init__.py protobuf/__init__.py
echo "🔍 Verifying Python Structure:"
ls -R
fi

- name: Setup & Test
run: |
if [ "${{ matrix.binding }}" == "python" ]; then
pip install uv
cd j2735codec/bindings/python
uv sync --reinstall-package j2735codec
uv run pytest tests -s
else
npm install
npm run build -w j2735codec
npm test -w j2735codec
fi

publish-release:
name: Publish Release
needs: [verify-version, test-bindings]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Build & Stage Assets
run: |
STAGING="$GITHUB_WORKSPACE/dist_release"
mkdir -p "$STAGING"
VERSION=$(cat VERSION)

# --- 2. Build Python Bindings ---
PY_DIR="j2735codec/bindings/python"

# Clean and Recreate Structure
mkdir -p "$PY_DIR/src/j2735codec/generated"
mkdir -p "$PY_DIR/src/j2735codec/protobuf"

# Copy artifacts - using '.' to ensure we copy contents into the pre-made folders
cp -a artifacts/python-wasm-binaries/. "$PY_DIR/src/j2735codec/"

# RE-INJECT Package Markers (Vital for Wheel packaging)
touch "$PY_DIR/src/j2735codec/__init__.py"
touch "$PY_DIR/src/j2735codec/generated/__init__.py"
touch "$PY_DIR/src/j2735codec/protobuf/__init__.py"

# Debug: Log the tree to the console so we can see what's happening
echo "📂 Final Python Build Tree:"
ls -R "$PY_DIR/src/j2735codec/"

cp LICENSE "$PY_DIR/"
cp NOTICE "$PY_DIR/"

pip install uv
cd "$PY_DIR"
uv build --wheel --out-dir ./dist_local

# Verify Wheel Contents before moving (Security Check)
WHL_FILE=$(ls ./dist_local/*.whl)
if ! unzip -l "$WHL_FILE" | grep -q "j2735codec/generated/j2735codec.wasm"; then
echo "::error::WASM file missing from generated wheel!"
exit 1
fi

for f in ./dist_local/*; do cp "$f" "$STAGING/$(basename $f)"; done
cd "$GITHUB_WORKSPACE"

# --- 3. Build Node Bindings ---
JS_DIR="j2735codec/bindings/node"
mkdir -p "$JS_DIR/src/generated/"
cp -a artifacts/node-wasm-binaries/. "$JS_DIR/src/generated/"
cp LICENSE "$JS_DIR/"
cp NOTICE "$JS_DIR/"
npm install
npm run build -w j2735codec
cd "$JS_DIR" && npm pack
for f in *.tgz; do cp "$f" "$STAGING/$f"; done
cd "$GITHUB_WORKSPACE"

# --- 4. Package Python Samples ---
SAMPLE_DIR="etx/examples/python"
if [ -d "$SAMPLE_DIR" ]; then
cp LICENSE "$SAMPLE_DIR/"
cp NOTICE "$SAMPLE_DIR/"

# Inject the language wrapper (the wheel)
mkdir -p "$SAMPLE_DIR/j2735codec"
cp "$STAGING"/*.whl "$SAMPLE_DIR/j2735codec/"

cd "$SAMPLE_DIR"
VERSION=$(cat "$GITHUB_WORKSPACE/VERSION")
ZIP_NAME="python-etx-samples-$VERSION.zip"
zip -r "$STAGING/$ZIP_NAME" . \
-x "*config.json" -x "*/.venv/*" -x "*.venv*" -x "*/.env*" -x "*/__pycache__/*"
cd "$GITHUB_WORKSPACE"
fi

# --- 5. Package Node/TS Samples ---
NODE_SAMPLE_DIR="etx/examples/node"
if [ -d "$NODE_SAMPLE_DIR" ]; then
VERSION=$(cat "$GITHUB_WORKSPACE/VERSION")
PKG_STAGING="$GITHUB_WORKSPACE/node_pkg_temp"
mkdir -p "$PKG_STAGING"

# 1. Copy the source (leaves your repo untouched)
cp -r "$NODE_SAMPLE_DIR"/. "$PKG_STAGING/"

# 2. Rewrite the path to the PORTABLE local path
# This changes the monorepo path to the ZIP-friendly path
sed -i "s|\"j2735codec\": \".*\"|\"j2735codec\": \"file:./j2735codec/j2735codec-$VERSION.tgz\"|g" "$PKG_STAGING/package.json"

# 3. Inject the tarball into the staging area
mkdir -p "$PKG_STAGING/j2735codec"
cp "$STAGING"/j2735codec-$VERSION.tgz "$PKG_STAGING/j2735codec/"

# 4. GENERATE THE LOCKFILE HERE
# This lockfile will now contain the correct, portable reference to the codec
cd "$PKG_STAGING"
npm install --package-lock-only --no-workspaces

# 5. ZIP EVERYTHING
# Now the ZIP contains a package.json and a package-lock.json
# that both point to the local ./j2735codec folder.
ZIP_NAME="node-etx-samples-$VERSION.zip"
zip -r "$STAGING/$ZIP_NAME" . -x "node_modules/*" "dist/*"

# We zip EVERYTHING (*) in this folder, excluding ONLY the junk
zip -r "$STAGING/$ZIP_NAME" . \
-x "certs/*" "dist/*" "node_modules/*" "config.json" ".env*" "npm-debug.log*"

cd "$GITHUB_WORKSPACE"
rm -rf "$PKG_STAGING"
fi

# --- 6. Finalize Staging ---
cp "$PY_DIR/src/j2735codec/generated/j2735codec.wasm" "$STAGING/j2735codec-$VERSION.wasm"
cp LICENSE "$STAGING/"
cp NOTICE "$STAGING/"

# --- 7. FIXED Safe Cleanup ---
echo "🧹 Performing final cleanup..."
# Do NOT use -delete on a broad glob. Delete specific files.
rm -f "$STAGING"/.DS_Store
rm -f "$STAGING"/.env
rm -f "$STAGING"/default.gitignore

echo "✅ Contents of $STAGING for release:"
ls -la "$STAGING"

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: "Release ${{ github.ref_name }}"
files: dist_release/*
generate_release_notes: true
87 changes: 87 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# =============================================================================
# Verizon ETX Starter Kit - Master Gitignore
# =============================================================================

# --- System & Editor Files ---
.DS_Store
Thumbs.db
*.swp
*.swo
.vscode/*
!.vscode/extensions.json
.idea/
.vs/
*.sln
*.vcxproj
*.user

# --- General Build Artifacts ---
# Catches all C++, Python, and Node build directories
build/
build_*/
_build/
out/
dist/
bin/
*.tgz
*.tsbuildinfo

# --- C++ / CMake / WASM Tooling ---
CMakeCache.txt
CMakeFiles/
CMakeScripts/
cmake_install.cmake
install_manifest.txt
CMakeUserPresets.json
vcpkg_installed/
.cmake/
cmake-build-*/

# Compiled Binaries
*.o
*.obj
*.so
*.a
*.lib
*.dll
*.exe
*.dylib
*.wasm
*.js.mem

# --- Python (Onboarding & Bindings) ---
.venv/
__pycache__/
*.py[cod]
*$py.class
*.egg-info/
.hatch/
.pytest_cache/
.mypy_cache/
.ruff_cache/
.coverage
htmlcov/

# --- Node.js (Onboarding & Bindings) ---
node_modules/
.npm/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.eslintcache

# --- Project Specific Patterns ---
# Explicitly ignoring generated WASM and metadata in specific subfolders
**/generated/*

# --- Environment & Secrets ---
# Never commit ETX credentials or local environment configs
.env
.env.local
.env.*.local
logs/
*.log
config.json
certs/

# =============================================================================
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.16.0
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Contributing to J2735 Codec

Thank you for helping improve the J2735 Codec. To maintain code quality and history, please follow these guidelines.

## 🌿 Branching Strategy
We follow a **Feature Branch** workflow. All development must occur on branches and be merged into `main` via Pull Request.

Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
BINDING_PY = j2735codec/bindings/python
BINDING_JS = j2735codec/bindings/node
SAMPLE_PY = etx/examples/python
SAMPLE_JS = etx/examples/node
VERSION ?= $(shell cat VERSION 2>/dev/null || echo "0.1.0")

sync-version:
@echo "🔄 Syncing version $(VERSION) to manifests..."
@# Update Root CMake
@perl -i -pe 's/VERSION\s+"[0-9.]+"/VERSION "$(VERSION)"/gi' j2735codec/CMakeLists.txt

@# Update Node manifests
@npm version $(VERSION) --no-git-tag-version --allow-same-version || true
@cd $(BINDING_JS) && npm version $(VERSION) --no-git-tag-version --allow-same-version || true
@cd $(SAMPLE_JS) && npm version $(VERSION) --no-git-tag-version --allow-same-version || true

@# Update Python manifests (root, binding, sample)
@perl -i -pe 's/^version\s*=\s*"[0-9.]*"/version = "$(VERSION)"/m' pyproject.toml
@perl -i -pe 's/^version\s*=\s*"[0-9.]*"/version = "$(VERSION)"/m' $(BINDING_PY)/pyproject.toml
@perl -i -pe 's/^version\s*=\s*"[0-9.]*"/version = "$(VERSION)"/m' $(SAMPLE_PY)/pyproject.toml

@echo "✅ Version $(VERSION) synced across 6 manifests and CMake."
Loading