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
10 changes: 8 additions & 2 deletions .github/workflows/onPushToMain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Set to your Node.js version
node-version: '24' # Same line as the Node bundled in the tarballs
registry-url: 'https://registry.npmjs.org/'

- name: Install dependencies
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
# Configured on npmjs.com: @apso/cli > Settings > Trusted Publisher
# (GitHub Actions, apsoai/cli, onPushToMain.yml, environment blank,
# "Allow npm publish" checked; without it only `npm stage publish` works).
# Build stays on Node 18 (what CI tests); publish needs npm >= 11.5.1,
# Build runs on Node 24 (what CI tests); publish needs npm >= 11.5.1,
# which needs Node 22.
# No registry-url: with it, setup-node writes an .npmrc that sends the
# NODE_AUTH_TOKEN placeholder (XXXXX-...) as the auth token, and npm then
Expand Down Expand Up @@ -111,6 +111,12 @@ jobs:
run: |
npx oclif pack tarballs --targets darwin-x64,darwin-arm64,linux-x64

# Run the linux tarball before anything is uploaded, so a broken bundle
# never reaches the GitHub Release or the Homebrew formula.
- name: Smoke test the linux tarball
if: steps.bump_version.outputs.newTag != ''
run: bash scripts/tarball-smoke.sh linux-x64

- name: Rename tarballs and compute checksums
if: steps.bump_version.outputs.newTag != ''
id: tarballs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scaffold-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "24"
registry-url: "https://npm.pkg.github.com"
scope: "@mavric"

Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/tarball-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: tarball smoke test

# Packs the linux standalone tarball (the Homebrew/curl bundle with its own
# Node) and runs it. Only on PRs that change what goes into the bundle, since
# packing downloads a Node binary.
on:
workflow_dispatch:
pull_request:
paths:
- package.json
- npm-shrinkwrap.json
- scripts/tarball-smoke.sh
- .github/workflows/tarball-smoke.yml

permissions:
contents: read

jobs:
tarball-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"

- run: npm ci
- run: npm run build
- run: bash scripts/tarball-smoke.sh linux-x64
7 changes: 6 additions & 1 deletion .github/workflows/unitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ permissions:
jobs:
build-and-publish:
runs-on: ubuntu-latest
strategy:
matrix:
# 24 is the Node bundled in the Homebrew tarballs; 22 is the oldest
# supported line, kept for npm installs on older machines.
node: ['22', '24']
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -18,7 +23,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Set to your Node.js version
node-version: ${{ matrix.node }}
registry-url: 'https://npm.pkg.github.com'
scope: '@mavric'

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ Apso generates production-ready backend services from a JSON schema file. You ge
**Homebrew** (macOS / Linux)

```bash
brew tap apsoai/tap
brew install apso
brew install apsoai/tap/apso
# Installed before Homebrew 6? Trust the formula so upgrades work:
# brew trust --formula apsoai/tap/apso
```

**npm**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
},
"update": {
"node": {
"version": "18.20.4",
"version": "24.22.1",
"targets": [
"darwin-x64",
"darwin-arm64",
Expand Down
39 changes: 39 additions & 0 deletions scripts/tarball-smoke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# Run the standalone tarball the way a Homebrew user gets it: the bundled Node
# must be the pinned version, and the CLI must start, validate a schema and
# run the PGlite migrate sandbox. Packs the tarball first unless one exists.
#
# Usage: scripts/tarball-smoke.sh [target] (default: linux-x64)
set -euo pipefail

target="${1:-linux-x64}"
cd "$(dirname "$0")/.."
root="$PWD"
want="v$(node -p "require('./package.json').oclif.update.node.version")"

tarball="$(ls dist/apso-v*-"$target".tar.gz 2>/dev/null | head -1 || true)"
if [ -z "$tarball" ]; then
npx oclif pack tarballs --targets "$target" --no-xz
tarball="$(ls dist/apso-v*-"$target".tar.gz | head -1)"
fi

work="$(mktemp -d)"
tar -xzf "$tarball" -C "$work"
apso="$work/apso/bin/apso"
export APSO_TELEMETRY_DISABLED=1

got="$("$work/apso/bin/node" --version)"
if [ "$got" != "$want" ]; then
echo "bundled node is $got, want $want" >&2
exit 1
fi
"$apso" --version
"$apso" --help >/dev/null

proj="$(mktemp -d)"
cp "$root/test/fixtures/inventory-multi-fk.apsorc" "$proj/.apsorc"
cd "$proj"
"$apso" schema validate >/dev/null
"$apso" migrate

echo "tarball smoke passed: $(basename "$tarball") on node $got"
Loading