Skip to content

Commit 056e15a

Browse files
Merge pull request #1482 from simstudioai/revert-1424-staging
Revert "v0.3.59: billing fixes, undo/redo, changelog, translations, start block deprecation, copilot refactor, deployment versioning, google vault"
2 parents 9e805d3 + 624f9c4 commit 056e15a

File tree

672 files changed

+7949
-85364
lines changed

Some content is hidden

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

672 files changed

+7949
-85364
lines changed

.github/workflows/build.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: Build and Publish Docker Image
2+
3+
on:
4+
push:
5+
branches: [main, staging]
6+
7+
jobs:
8+
build-and-push:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
# AMD64 builds on x86 runners
14+
- dockerfile: ./docker/app.Dockerfile
15+
image: ghcr.io/simstudioai/simstudio
16+
platform: linux/amd64
17+
arch: amd64
18+
runner: linux-x64-8-core
19+
- dockerfile: ./docker/db.Dockerfile
20+
image: ghcr.io/simstudioai/migrations
21+
platform: linux/amd64
22+
arch: amd64
23+
runner: linux-x64-8-core
24+
- dockerfile: ./docker/realtime.Dockerfile
25+
image: ghcr.io/simstudioai/realtime
26+
platform: linux/amd64
27+
arch: amd64
28+
runner: linux-x64-8-core
29+
# ARM64 builds on native ARM64 runners
30+
- dockerfile: ./docker/app.Dockerfile
31+
image: ghcr.io/simstudioai/simstudio
32+
platform: linux/arm64
33+
arch: arm64
34+
runner: linux-arm64-8-core
35+
- dockerfile: ./docker/db.Dockerfile
36+
image: ghcr.io/simstudioai/migrations
37+
platform: linux/arm64
38+
arch: arm64
39+
runner: linux-arm64-8-core
40+
- dockerfile: ./docker/realtime.Dockerfile
41+
image: ghcr.io/simstudioai/realtime
42+
platform: linux/arm64
43+
arch: arm64
44+
runner: linux-arm64-8-core
45+
runs-on: ${{ matrix.runner }}
46+
permissions:
47+
contents: read
48+
packages: write
49+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
54+
- name: Set up Docker Buildx
55+
uses: docker/setup-buildx-action@v3
56+
57+
- name: Log in to the Container registry
58+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
59+
uses: docker/login-action@v3
60+
with:
61+
registry: ghcr.io
62+
username: ${{ github.repository_owner }}
63+
password: ${{ secrets.GITHUB_TOKEN }}
64+
65+
- name: Extract metadata (tags, labels) for Docker
66+
id: meta
67+
uses: docker/metadata-action@v5
68+
with:
69+
images: ${{ matrix.image }}
70+
tags: |
71+
type=raw,value=latest-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/main' }}
72+
type=raw,value=staging-${{ github.sha }}-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/staging' }}
73+
type=sha,format=long,suffix=-${{ matrix.arch }}
74+
75+
- name: Build and push Docker image
76+
uses: docker/build-push-action@v6
77+
with:
78+
context: .
79+
file: ${{ matrix.dockerfile }}
80+
platforms: ${{ matrix.platform }}
81+
push: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
82+
tags: ${{ steps.meta.outputs.tags }}
83+
labels: ${{ steps.meta.outputs.labels }}
84+
cache-from: type=gha,scope=build-v3
85+
cache-to: type=gha,mode=max,scope=build-v3
86+
provenance: false
87+
sbom: false
88+
89+
create-manifests:
90+
runs-on: ubuntu-latest
91+
needs: build-and-push
92+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
93+
strategy:
94+
matrix:
95+
include:
96+
- image: ghcr.io/simstudioai/simstudio
97+
- image: ghcr.io/simstudioai/migrations
98+
- image: ghcr.io/simstudioai/realtime
99+
permissions:
100+
contents: read
101+
packages: write
102+
103+
steps:
104+
- name: Log in to the Container registry
105+
uses: docker/login-action@v3
106+
with:
107+
registry: ghcr.io
108+
username: ${{ github.repository_owner }}
109+
password: ${{ secrets.GITHUB_TOKEN }}
110+
111+
- name: Extract metadata for manifest
112+
id: meta
113+
uses: docker/metadata-action@v5
114+
with:
115+
images: ${{ matrix.image }}
116+
tags: |
117+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
118+
type=sha,format=long
119+
120+
- name: Create and push manifest
121+
run: |
122+
# Extract the tags from metadata (these are the final manifest tags we want)
123+
MANIFEST_TAGS="${{ steps.meta.outputs.tags }}"
124+
125+
# Create manifest for each tag
126+
for manifest_tag in $MANIFEST_TAGS; do
127+
echo "Creating manifest for $manifest_tag"
128+
129+
# The architecture-specific images have -amd64 and -arm64 suffixes
130+
amd64_image="${manifest_tag}-amd64"
131+
arm64_image="${manifest_tag}-arm64"
132+
133+
echo "Looking for images: $amd64_image and $arm64_image"
134+
135+
# Check if both architecture images exist
136+
if docker manifest inspect "$amd64_image" >/dev/null 2>&1 && docker manifest inspect "$arm64_image" >/dev/null 2>&1; then
137+
echo "Both images found, creating manifest..."
138+
docker manifest create "$manifest_tag" \
139+
"$amd64_image" \
140+
"$arm64_image"
141+
docker manifest push "$manifest_tag"
142+
echo "Successfully created and pushed manifest for $manifest_tag"
143+
else
144+
echo "Error: One or both architecture images not found"
145+
echo "Checking AMD64 image: $amd64_image"
146+
docker manifest inspect "$amd64_image" || echo "AMD64 image not found"
147+
echo "Checking ARM64 image: $arm64_image"
148+
docker manifest inspect "$arm64_image" || echo "ARM64 image not found"
149+
exit 1
150+
fi
151+
done

.github/workflows/ci.yml

Lines changed: 64 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,74 @@ on:
66
pull_request:
77
branches: [main, staging]
88

9-
concurrency:
10-
group: ci-${{ github.ref }}
11-
cancel-in-progress: false
12-
139
jobs:
14-
test-build:
10+
test:
1511
name: Test and Build
16-
uses: ./.github/workflows/test-build.yml
17-
secrets: inherit
12+
runs-on: ubuntu-latest
1813

19-
# Build and push images (ECR for staging, ECR + GHCR for main)
20-
build-images:
21-
name: Build Images
22-
needs: test-build
23-
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
24-
uses: ./.github/workflows/images.yml
25-
secrets: inherit
26-
permissions:
27-
contents: read
28-
packages: write
29-
id-token: write
30-
31-
# Deploy Trigger.dev (after builds complete)
32-
trigger-deploy:
33-
name: Deploy Trigger.dev
34-
needs: build-images
35-
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
36-
uses: ./.github/workflows/trigger-deploy.yml
37-
secrets: inherit
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Bun
19+
uses: oven-sh/setup-bun@v2
20+
with:
21+
bun-version: latest
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: latest
27+
28+
- name: Install dependencies
29+
run: bun install --frozen-lockfile
30+
31+
- name: Run tests with coverage
32+
env:
33+
NODE_OPTIONS: '--no-warnings'
34+
NEXT_PUBLIC_APP_URL: 'https://www.sim.ai'
35+
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/simstudio'
36+
ENCRYPTION_KEY: '7cf672e460e430c1fba707575c2b0e2ad5a99dddf9b7b7e3b5646e630861db1c' # dummy key for CI only
37+
run: bun run test
38+
39+
- name: Build application
40+
env:
41+
NODE_OPTIONS: '--no-warnings'
42+
NEXT_PUBLIC_APP_URL: 'https://www.sim.ai'
43+
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/simstudio'
44+
STRIPE_SECRET_KEY: 'dummy_key_for_ci_only'
45+
STRIPE_WEBHOOK_SECRET: 'dummy_secret_for_ci_only'
46+
RESEND_API_KEY: 'dummy_key_for_ci_only'
47+
AWS_REGION: 'us-west-2'
48+
ENCRYPTION_KEY: '7cf672e460e430c1fba707575c2b0e2ad5a99dddf9b7b7e3b5646e630861db1c' # dummy key for CI only
49+
run: bun run build
50+
51+
- name: Upload coverage to Codecov
52+
uses: codecov/codecov-action@v5
53+
with:
54+
directory: ./apps/sim/coverage
55+
fail_ci_if_error: false
56+
verbose: true
3857

39-
# Run database migrations (depends on build completion and trigger deployment)
4058
migrations:
4159
name: Apply Database Migrations
42-
needs: [build-images, trigger-deploy]
43-
if: |
44-
always() &&
45-
github.event_name == 'push' &&
46-
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging') &&
47-
needs.build-images.result == 'success' &&
48-
needs.trigger-deploy.result == 'success'
49-
uses: ./.github/workflows/migrations.yml
50-
secrets: inherit
51-
52-
# Process docs embeddings if needed
53-
process-docs:
54-
name: Process Docs
55-
needs: migrations
60+
runs-on: ubuntu-latest
5661
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
57-
uses: ./.github/workflows/docs-embeddings.yml
58-
secrets: inherit
62+
needs: test
63+
steps:
64+
- name: Checkout code
65+
uses: actions/checkout@v4
66+
67+
- name: Setup Bun
68+
uses: oven-sh/setup-bun@v2
69+
with:
70+
bun-version: latest
71+
72+
- name: Install dependencies
73+
run: bun install
74+
75+
- name: Apply migrations
76+
working-directory: ./packages/db
77+
env:
78+
DATABASE_URL: ${{ github.ref == 'refs/heads/main' && secrets.DATABASE_URL || secrets.STAGING_DATABASE_URL }}
79+
run: bunx drizzle-kit migrate --config=./drizzle.config.ts

.github/workflows/docs-embeddings.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
name: Process Docs Embeddings
22

33
on:
4-
workflow_call:
4+
push:
5+
branches: [main, staging]
6+
paths:
7+
- 'apps/docs/**'
58
workflow_dispatch: # Allow manual triggering
69

710
jobs:
811
process-docs-embeddings:
912
name: Process Documentation Embeddings
10-
runs-on: blacksmith-4vcpu-ubuntu-2404
13+
runs-on: ubuntu-latest
1114
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging'
1215

1316
steps:

.github/workflows/i18n.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
translate:
17-
runs-on: blacksmith-4vcpu-ubuntu-2404
17+
runs-on: ubuntu-latest
1818
if: github.actor != 'github-actions[bot]' # Prevent infinite loops
1919

2020
steps:
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
token: ${{ secrets.GH_PAT }}
5757
commit-message: "feat(i18n): update translations"
58-
title: "feat(i18n): update translations"
58+
title: "🌐 Auto-update translations"
5959
body: |
6060
## Summary
6161
Automated translation updates triggered by changes to documentation.
@@ -76,10 +76,8 @@ jobs:
7676
## Testing
7777
This PR includes automated translations for modified English documentation content:
7878
- 🇪🇸 Spanish (es) translations
79-
- 🇫🇷 French (fr) translations
79+
- 🇫🇷 French (fr) translations
8080
- 🇨🇳 Chinese (zh) translations
81-
- 🇯🇵 Japanese (ja) translations
82-
- 🇩🇪 German (de) translations
8381
8482
**What reviewers should focus on:**
8583
- Verify translated content accuracy and context
@@ -104,7 +102,7 @@ jobs:
104102
105103
verify-translations:
106104
needs: translate
107-
runs-on: blacksmith-4vcpu-ubuntu-2404
105+
runs-on: ubuntu-latest
108106
if: always() # Run even if translation fails
109107

110108
steps:
@@ -139,21 +137,15 @@ jobs:
139137
es_count=$(find content/docs/es -name "*.mdx" 2>/dev/null | wc -l || echo 0)
140138
fr_count=$(find content/docs/fr -name "*.mdx" 2>/dev/null | wc -l || echo 0)
141139
zh_count=$(find content/docs/zh -name "*.mdx" 2>/dev/null | wc -l || echo 0)
142-
ja_count=$(find content/docs/ja -name "*.mdx" 2>/dev/null | wc -l || echo 0)
143-
de_count=$(find content/docs/de -name "*.mdx" 2>/dev/null | wc -l || echo 0)
144140
145141
es_percentage=$((es_count * 100 / en_count))
146142
fr_percentage=$((fr_count * 100 / en_count))
147143
zh_percentage=$((zh_count * 100 / en_count))
148-
ja_percentage=$((ja_count * 100 / en_count))
149-
de_percentage=$((de_count * 100 / en_count))
150144
151145
echo "### Coverage Statistics" >> $GITHUB_STEP_SUMMARY
152146
echo "- **🇬🇧 English**: $en_count files (source)" >> $GITHUB_STEP_SUMMARY
153147
echo "- **🇪🇸 Spanish**: $es_count/$en_count files ($es_percentage%)" >> $GITHUB_STEP_SUMMARY
154148
echo "- **🇫🇷 French**: $fr_count/$en_count files ($fr_percentage%)" >> $GITHUB_STEP_SUMMARY
155149
echo "- **🇨🇳 Chinese**: $zh_count/$en_count files ($zh_percentage%)" >> $GITHUB_STEP_SUMMARY
156-
echo "- **🇯🇵 Japanese**: $ja_count/$en_count files ($ja_percentage%)" >> $GITHUB_STEP_SUMMARY
157-
echo "- **🇩🇪 German**: $de_count/$en_count files ($de_percentage%)" >> $GITHUB_STEP_SUMMARY
158150
echo "" >> $GITHUB_STEP_SUMMARY
159151
echo "🔄 **Auto-translation PR**: Check for new pull request with updated translations" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)