Skip to content

Commit 0c3de74

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
Merge staging into feat/quickbooks-integration
2 parents 831490d + f210a6e commit 0c3de74

284 files changed

Lines changed: 32347 additions & 4858 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ After running this command, open [http://localhost:3000/](http://localhost:3000/
165165
git clone https://github.com/<your-username>/sim.git
166166
cd sim
167167

168+
# Generate the required secrets. The stack refuses to start without them
169+
# rather than booting with empty values.
170+
cat > .env << EOF
171+
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
172+
ENCRYPTION_KEY=$(openssl rand -hex 32)
173+
INTERNAL_API_SECRET=$(openssl rand -hex 32)
174+
CRON_SECRET=$(openssl rand -hex 32)
175+
EOF
176+
168177
# Start Sim
169178
docker compose -f docker-compose.prod.yml up -d
170179
```

.github/workflows/ci.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,12 @@ jobs:
294294
ecr_repo_secret: ECR_PII
295295
gh_runner: ubuntu-latest
296296
bs_runner: blacksmith-4vcpu-ubuntu-2404
297+
# No ECR repo is provisioned for cron, so it publishes to GHCR only.
298+
# The tag step below omits the ECR tag when the repo name is empty.
299+
- dockerfile: ./docker/cron.Dockerfile
300+
ghcr_image: ghcr.io/simstudioai/cron
301+
gh_runner: ubuntu-latest
302+
bs_runner: blacksmith-2vcpu-ubuntu-2404
297303
steps:
298304
- name: Checkout code
299305
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
@@ -338,15 +344,33 @@ jobs:
338344
ECR_REPO="${{ steps.ecr-repo.outputs.name }}"
339345
GHCR_IMAGE="${{ matrix.ghcr_image }}"
340346
341-
TAGS="${ECR_REGISTRY}/${ECR_REPO}:${{ github.sha }}"
347+
TAGS=""
348+
if [ -n "$ECR_REPO" ]; then
349+
TAGS="${ECR_REGISTRY}/${ECR_REPO}:${{ github.sha }}"
350+
fi
342351
343352
if [ "${{ github.ref }}" = "refs/heads/main" ] && [ -n "$GHCR_IMAGE" ]; then
344-
TAGS="${TAGS},${GHCR_IMAGE}:${{ github.sha }}-amd64"
353+
if [ -n "$TAGS" ]; then
354+
TAGS="${TAGS},${GHCR_IMAGE}:${{ github.sha }}-amd64"
355+
else
356+
TAGS="${GHCR_IMAGE}:${{ github.sha }}-amd64"
357+
fi
358+
fi
359+
360+
# An entry can legitimately resolve to no tags — e.g. the cron image has
361+
# no ECR repo, so on staging/dev (where GHCR tags are not applied) there
362+
# is nothing to push. Skip that build instead of failing the job.
363+
if [ -z "$TAGS" ]; then
364+
echo "No ECR repo and no GHCR tag for this entry on ${{ github.ref }} — skipping push."
365+
echo "skip=true" >> $GITHUB_OUTPUT
366+
else
367+
echo "skip=false" >> $GITHUB_OUTPUT
345368
fi
346369
347370
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
348371
349372
- name: Build and push images
373+
if: steps.meta.outputs.skip != 'true'
350374
uses: ./.github/actions/docker-build
351375
with:
352376
provider: ${{ vars.CI_PROVIDER }}
@@ -470,6 +494,10 @@ jobs:
470494
image: ghcr.io/simstudioai/pii
471495
gh_runner: ubuntu-24.04-arm
472496
bs_runner: blacksmith-4vcpu-ubuntu-2404-arm
497+
- dockerfile: ./docker/cron.Dockerfile
498+
image: ghcr.io/simstudioai/cron
499+
gh_runner: ubuntu-24.04-arm
500+
bs_runner: blacksmith-4vcpu-ubuntu-2404-arm
473501

474502
steps:
475503
- name: Checkout code
@@ -515,6 +543,7 @@ jobs:
515543
- image: ghcr.io/simstudioai/migrations
516544
- image: ghcr.io/simstudioai/realtime
517545
- image: ghcr.io/simstudioai/pii
546+
- image: ghcr.io/simstudioai/cron
518547

519548
steps:
520549
- name: Login to GHCR

.github/workflows/helm.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ jobs:
3232
with:
3333
version: v3.16.4
3434

35+
- name: Setup Bun
36+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
37+
with:
38+
bun-version: 1.3.13
39+
40+
# Docker Compose and Kubernetes must run the same background jobs on the
41+
# same schedules; this fails the build if the two drift apart. The script
42+
# imports only node builtins, so this job installs no dependencies.
43+
- name: Scheduler parity (docker/crontab vs helm cronjobs)
44+
run: bun run scripts/check-cron-parity.ts
45+
3546
- name: Helm lint
3647
run: helm lint helm/sim --values helm/sim/ci/default-values.yaml
3748

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<p align="center">
99
<a href="https://deepwiki.com/simstudioai/sim" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/Ask-DeepWiki-E6E6E6?labelColor=C3C3C3&color=E6E6E6" alt="Ask DeepWiki"></a>
10-
<a href="https://cursor.com/link/prompt?text=Help%20me%20set%20up%20Sim%20locally.%20Follow%20these%20steps%3A%0A%0A1.%20First%2C%20verify%20Docker%20is%20installed%20and%20running%3A%0A%20%20%20docker%20--version%0A%20%20%20docker%20info%0A%0A2.%20Clone%20the%20repository%3A%0A%20%20%20git%20clone%20https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim.git%0A%20%20%20cd%20sim%0A%0A3.%20Start%20the%20services%20with%20Docker%20Compose%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20up%20-d%0A%0A4.%20Wait%20for%20all%20containers%20to%20be%20healthy%20(this%20may%20take%201-2%20minutes)%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20ps%0A%0A5.%20Verify%20the%20app%20is%20accessible%20at%20http%3A%2F%2Flocalhost%3A3000%0A%0AIf%20there%20are%20any%20errors%2C%20help%20me%20troubleshoot%20them.%20Common%20issues%3A%0A-%20Port%203000%2C%203002%2C%20or%205432%20already%20in%20use%0A-%20Docker%20not%20running%0A-%20Insufficient%20memory%20(needs%2012GB%2B%20RAM)%0A%0AFor%20local%20AI%20models%20with%20Ollama%2C%20use%20this%20instead%20of%20step%203%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.ollama.yml%20--profile%20setup%20up%20-d"><img src="https://img.shields.io/badge/Set%20Up%20with-Cursor-E6E6E6?logo=cursor&logoColor=1A1A1A&labelColor=C3C3C3&color=E6E6E6" alt="Set Up with Cursor"></a>
10+
<a href="https://cursor.com/link/prompt?text=Help%20me%20set%20up%20Sim%20locally.%20Follow%20these%20steps%3A%0A%0A1.%20First%2C%20verify%20Docker%20is%20installed%20and%20running%3A%0A%20%20%20docker%20--version%0A%20%20%20docker%20info%0A%0A2.%20Clone%20the%20repository%3A%0A%20%20%20git%20clone%20https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim.git%0A%20%20%20cd%20sim%0A%0A3.%20Generate%20required%20secrets%20%28the%20stack%20will%20not%20start%20without%20them%29%3A%0A%20%20%20cat%20%3E%20.env%20%3C%3C%20EOF%0A%20%20%20BETTER_AUTH_SECRET%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20ENCRYPTION_KEY%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20INTERNAL_API_SECRET%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20CRON_SECRET%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20EOF%0A%0A4.%20Start%20the%20services%20with%20Docker%20Compose%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20up%20-d%0A%0A4.%20Wait%20for%20all%20containers%20to%20be%20healthy%20(this%20may%20take%201-2%20minutes)%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20ps%0A%0A5.%20Verify%20the%20app%20is%20accessible%20at%20http%3A%2F%2Flocalhost%3A3000%0A%0AIf%20there%20are%20any%20errors%2C%20help%20me%20troubleshoot%20them.%20Common%20issues%3A%0A-%20Port%203000%2C%203002%2C%20or%205432%20already%20in%20use%0A-%20Docker%20not%20running%0A-%20Insufficient%20memory%20(needs%2012GB%2B%20RAM)%0A%0AFor%20local%20AI%20models%20with%20Ollama%2C%20use%20this%20instead%20of%20step%203%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.ollama.yml%20--profile%20setup%20up%20-d"><img src="https://img.shields.io/badge/Set%20Up%20with-Cursor-E6E6E6?logo=cursor&logoColor=1A1A1A&labelColor=C3C3C3&color=E6E6E6" alt="Set Up with Cursor"></a>
1111
</p>
1212

1313
<p align="center">

apps/desktop/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dist/
22
release/
3-
build/generated-icon.icns
3+
build/generated-icon.icon
44
playwright-report/
55
test-results/

apps/desktop/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Local unsigned build: `bun run package:dir` (app in `release/mac-universal/`). S
100100

101101
Pre-release share (no Developer ID yet): `SIM_DESKTOP_DEFAULT_ORIGIN=https://www.dev.sim.ai bun run package:share` builds a DMG whose fresh installs default to that origin (baked at build time; official builds leave it unset → prod) and skips per-file signature timestamps. Recipients must clear quarantine once: `xattr -cr /Applications/Sim.app`.
102102

103-
The build also derives the app icon from `SIM_DESKTOP_DEFAULT_ORIGIN`. Every channel uses the exact production icon with its white background and black `sim` mark. Non-production channels add a thin outline using existing platform colors: dev uses orange, staging uses Loop blue, and localhost uses Workflow violet. The macOS menu-bar icon also carries a compact `D`, `S`, or `L` subscript for those environments; production remains unmarked. Packaged `.icns` files live in `build/`; `scripts/build.ts` copies the selected variant to the ignored `build/generated-icon.icns` path consumed by electron-builder. Matching 512px PNGs in `static/` provide the Dock icon for unpackaged runs.
103+
The build also derives the app icon from `SIM_DESKTOP_DEFAULT_ORIGIN`. Every channel uses the exact production icon with its white background and black `sim` mark. Non-production channels add a thin outline using existing platform colors: dev uses orange, staging uses Loop blue, and localhost uses Workflow violet. The macOS menu-bar icon also carries a compact `D`, `S`, or `L` subscript for those environments; production remains unmarked. Native Icon Composer assets live in `build/`; `scripts/build.ts` copies the selected variant to the ignored `build/generated-icon.icon` path consumed by electron-builder. Electron-builder compiles it to `Assets.car` and derives the legacy `.icns` fallback from the same source. Matching 512px PNGs in `static/` provide the Dock icon for unpackaged runs.
104104

105105
CI (`.github/workflows/desktop-release.yml`, wired into `ci.yml`):
106106
- Runs only after `create-release` on a `vX.Y.Z:` commit to main — **never before**: `scripts/create-single-release.ts` skips creation if the tag exists, so a desktop job publishing first would eat the changelog. The job builds `--publish never` and uploads assets with `gh release upload --clobber` (idempotent re-runs).

apps/desktop/build/icon-dev.icns

-122 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)