Skip to content

fix: compat issues #57/#58/#59 + Liquid AI tool-call parser (v1.3.1) #95

fix: compat issues #57/#58/#59 + Liquid AI tool-call parser (v1.3.1)

fix: compat issues #57/#58/#59 + Liquid AI tool-call parser (v1.3.1) #95

Workflow file for this run

# Builds smallcode for Windows, macOS, and Linux.
# On tag push (v*) creates a GitHub Release with platform-specific portable
# tarballs containing pre-built JS + all production node_modules (including
# pre-compiled native addons). Users extract and run without ever needing
# node-gyp / C++ build tools.
name: Build and Release
on:
push:
branches: [master]
tags: ['v*']
pull_request:
branches: [master]
# Force JavaScript actions to run on Node.js 24 to avoid deprecation warnings.
# Node.js 20 actions are deprecated and will be removed September 16th, 2026.
# https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# Release job needs contents: write to create GitHub Releases.
# Default GITHUB_TOKEN on forks may not have auto-generated release notes API access,
# so we omit generate_release_notes and rely on manual release notes editing.
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.os }})
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-2022]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies (including optional – compiles native addons)
run: npm ci --include=optional
- name: Compile TypeScript → JavaScript
run: npm run build
- name: Strip dev dependencies (keep prod + optional only)
run: npm prune --omit=dev
- name: Package platform-specific tarball
run: |
PLATFORM_TAG="${{ runner.os }}-${{ runner.arch }}"
mkdir -p _staging/smallcode
# Copy production files
cp -r bin _staging/smallcode/
cp -r src _staging/smallcode/
cp -r node_modules _staging/smallcode/
cp package.json _staging/smallcode/
cp package-lock.json _staging/smallcode/
cp smallcode.toml _staging/smallcode/
cp mcp.json _staging/smallcode/
cp .env.example _staging/smallcode/
cp README.md _staging/smallcode/ 2>/dev/null || true
cp LICENSE _staging/smallcode/ 2>/dev/null || true
# Additional support files matching npm pack contents
cp install.sh _staging/smallcode/ 2>/dev/null || true
cp install.ps1 _staging/smallcode/ 2>/dev/null || true
cp -r extensions _staging/smallcode/ 2>/dev/null || true
cp -r marrow _staging/smallcode/ 2>/dev/null || true
# Remove TypeScript sources from compiled/ – ship .js only
find _staging/smallcode/src/compiled -name '*.ts' -delete
rm -f _staging/smallcode/src/compiled/tsconfig.json
# Create tarball
cd _staging && tar czf "../smallcode-${PLATFORM_TAG}.tar.gz" smallcode/
cd .. && rm -rf _staging
du -sh "smallcode-${PLATFORM_TAG}.tar.gz"
- uses: actions/upload-artifact@v4
with:
name: smallcode-${{ runner.os }}-${{ runner.arch }}
path: smallcode-*.tar.gz
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: smallcode-*
merge-multiple: true
- name: List release assets
run: ls -lh smallcode-*.tar.gz
- name: Extract changelog section for this version
run: |
TAG="${GITHUB_REF#refs/tags/}"
VERSION="${TAG#v}"
# Portable awk (works on mawk + gawk + macOS bsdawk).
# Captures lines from the matching version header up to the next
# version header. The header pattern matches `## [X.Y.Z]` or
# `## [X.Y.Z-suffix]`.
cat > .github/_extract.awk << 'AWKEOF'
$0 ~ "^## \\[" ver "\\]" { found = 1; print; next }
found && /^## \[/ { exit }
found == 1 { print }
AWKEOF
awk -v ver="$VERSION" -f .github/_extract.awk CHANGELOG.md > _release_body.md || true
echo "Extracted $(wc -c < _release_body.md) bytes for version $VERSION"
- uses: softprops/action-gh-release@v2
with:
body_path: _release_body.md
files: smallcode-*.tar.gz