create-disposabl-app 0.18.1 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/disposabl.js +1 -1
  2. package/dist/index.js +11 -4
  3. package/dist/templates/default/.github/scripts/release.sh +12 -6
  4. package/dist/templates/default/.github/workflows/pipeline.yml +1 -538
  5. package/dist/templates/default/apps/mobile/eas.json +3 -1
  6. package/dist/templates/default/apps/mobile/modules/storefront-observer/README.md +9 -0
  7. package/dist/templates/default/apps/mobile/modules/storefront-observer/expo-module.config.json +1 -0
  8. package/dist/templates/default/apps/mobile/modules/storefront-observer/ios/StorefrontObserver.podspec +15 -0
  9. package/dist/templates/default/apps/mobile/modules/storefront-observer/ios/StorefrontObserverModule.swift +59 -0
  10. package/dist/templates/default/apps/mobile/modules/storefront-observer/package.json +7 -0
  11. package/dist/templates/default/apps/mobile/scripts/play-aab.mjs +61 -15
  12. package/dist/templates/default/apps/mobile/scripts/verify-play-aab.mjs +1 -1
  13. package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.api-keys.tsx +2 -1
  14. package/dist/templates/default/packages/disposabl-kit/client/lib/telemetry-lease.ts +8 -1
  15. package/dist/templates/default/packages/disposabl-kit/client/routes/pricing.tsx +53 -7
  16. package/dist/templates/default/packages/disposabl-kit/mobile/billing/storefront-observer.ts +45 -0
  17. package/dist/templates/default/packages/disposabl-kit/mobile/billing/web-checkout.ts +39 -7
  18. package/dist/templates/default/packages/tests/android-failure-workflow.test.ts +10 -4
  19. package/dist/templates/default/packages/tests/billing-setup-hooks.test.ts +17 -6
  20. package/dist/templates/default/packages/tests/components/mobile-storefront-observer.test.mjs +241 -0
  21. package/dist/templates/default/packages/tests/mobile-storefront-observer.test.ts +22 -0
  22. package/dist/templates/default/packages/tests/package-release.test.ts +121 -0
  23. package/dist/templates/default/packages/tests/ui-telemetry-lease.test.ts +46 -0
  24. package/package.json +1 -1
@@ -1,538 +1 @@
1
- name: Pipeline
2
- on:
3
- pull_request:
4
- branches: [main]
5
- push:
6
- branches: [main]
7
- permissions:
8
- contents: read
9
- pull-requests: read
10
- concurrency:
11
- group: ${{ github.workflow }}-${{ github.ref }}
12
- # Cancel obsolete PRs; finish active production releases and keep only the latest pending run.
13
- cancel-in-progress: ${{ github.event_name == 'pull_request' }}
14
- env:
15
- CHANNEL: &channel ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'production' }}
16
- DISPOSABL_MOBILE_CHANNEL: *channel
17
- EAS_ENVIRONMENT: ${{ github.event_name == 'push' && 'production' || 'preview' }}
18
- EAS_CLI: eas-cli@27.2.0
19
- BUN_VERSION: &bun-version "1.4.4"
20
- NODE_VERSION: &node-version "24"
21
- LINUX_RUNNER: &linux-runner ubuntu-24.04
22
- WEB_RUNNER: ubuntu-24.04
23
- WINDOWS_RUNNER: windows-2025
24
- MACOS_RUNNER: macos-26
25
- RELEASE_PREFIX: app
26
- DISPOSABL_ANDROID_VERSION_CODE: ${{ github.run_number }}
27
- DISPOSABL_IOS_BUILD_NUMBER: ${{ github.run_number }}
28
- # Build jobs only read this repository. Keep installation tokens in publishing jobs.
29
- GH_TOKEN: ${{ github.token }}
30
- GH_REPO: ${{ github.repository }}
31
- SOURCE: ${{ github.event.pull_request.head.sha || github.sha }}
32
- SOURCE_PATH: ${{ github.event_name == 'pull_request' && format('pulls/{0}', github.event.number) || 'git/ref/heads/main' }}
33
- DISPOSABL_RELEASE_VERSION: 1.0.${{ github.run_number }}
34
- jobs:
35
- changes:
36
- name: Select work
37
- if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
38
- permissions:
39
- contents: read
40
- pull-requests: read
41
- actions: read
42
- runs-on: *linux-runner
43
- timeout-minutes: 5
44
- outputs:
45
- linux_runner: ${{ steps.platforms.outputs.linux_runner }}
46
- android_runner: ${{ steps.platforms.outputs.android_runner }}
47
- macos_runner: ${{ steps.platforms.outputs.macos_runner }}
48
- changed: ${{ steps.platforms.outputs.changed }}
49
- android: ${{ steps.platforms.outputs.android }}
50
- ios: ${{ steps.platforms.outputs.ios }}
51
- desktop: ${{ steps.platforms.outputs.desktop }}
52
- packages: ${{ steps.platforms.outputs.packages }}
53
- steps:
54
- - &checkout
55
- uses: actions/checkout@v6
56
- with: { ref: "${{ env.SOURCE }}", persist-credentials: false }
57
- - name: Select affected platforms
58
- shell: bash
59
- id: platforms
60
- env:
61
- PR: ${{ github.event.number }}
62
- EXPO_CONNECTED: ${{ secrets.EXPO_TOKEN != '' }}
63
- IOS_BUILDS_ENABLED: ${{ vars.IOS_BUILDS_ENABLED != 'false' }}
64
- run: bash "$GITHUB_WORKSPACE/.github/scripts/platforms.sh"
65
- web:
66
- name: Web
67
- needs: changes
68
- # Fork code must not run in a job with deployment credentials.
69
- if: needs.changes.outputs.changed == 'true'
70
- permissions: &release-permissions
71
- contents: read
72
- pull-requests: read
73
- id-token: write
74
- timeout-minutes: 20
75
- runs-on: ${{ needs.changes.outputs.linux_runner }}
76
- outputs:
77
- desktop: ${{ needs.changes.outputs.desktop }}
78
- ios: ${{ needs.changes.outputs.ios }}
79
- packages: ${{ needs.changes.outputs.packages }}
80
- release: ${{ steps.artifacts.outcome == 'success' }}
81
- android_build: ${{ steps.fingerprint.outputs.build }}
82
- android_runtime: ${{ steps.fingerprint.outputs.runtime }}
83
- convex_url: ${{ steps.deploy.outputs.CONVEX_URL }}
84
- convex_site_url: ${{ steps.deploy.outputs.CONVEX_SITE_URL }}
85
- env:
86
- PLATFORM: android
87
- ANDROID_SIGNING_READY: ${{ secrets.DISPOSABL_ANDROID_SIGNING != '' || (secrets.ANDROID_KEYSTORE_BASE64 != '' && secrets.ANDROID_KEYSTORE_PASSWORD != '' && secrets.ANDROID_KEY_ALIAS != '' && secrets.ANDROID_KEY_PASSWORD != '') }}
88
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
89
- EXPO_PROJECT_ID: ${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}
90
- EXPO_OWNER: ${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}
91
- EXPO_SLUG: ${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}
92
- EXPO_NO_DOTENV: "1"
93
- steps:
94
- - *checkout
95
- - &node
96
- uses: actions/setup-node@v6
97
- with: { node-version: *node-version, package-manager-cache: false }
98
- - &bun
99
- uses: oven-sh/setup-bun@v2
100
- with: { bun-version: *bun-version }
101
- - &cache
102
- uses: actions/cache@v4
103
- with:
104
- path: ~/.bun/install/cache
105
- key: bun-${{ github.job == 'desktop' && 'desktop-' || '' }}${{ runner.os }}-${{ runner.arch }}-${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }}
106
- restore-keys: bun-${{ github.job == 'desktop' && 'desktop-' || '' }}${{ runner.os }}-${{ runner.arch }}-${{ env.BUN_VERSION }}-
107
- - &install
108
- run: bun install --frozen-lockfile ${{ github.job == 'desktop' && '--filter "*desktop*" --filter @disposabl/backend' || (github.job == 'android' || startsWith(github.job, 'ios-')) && '--filter @disposabl/mobile' || '' }}
109
- - name: Report build start
110
- run: |
111
- node .github/scripts/disposabl.mjs report web,api,mcp building
112
- if [[ -z "$EXPO_TOKEN" ]]; then node .github/scripts/disposabl.mjs report android blocked 'Connect Expo before building Android.'; fi
113
- if [[ '${{ github.event_name }}' == pull_request ]]; then node .github/scripts/disposabl.mjs report cli,typescript-sdk blocked 'Packages publish after merge to main.'; fi
114
- - name: Check
115
- run: bun run check
116
- - name: Build selected clients
117
- run: |
118
- for package in cli sdk; do
119
- if test -f "packages/$package/package.json"; then bun run --cwd "packages/$package" build; fi
120
- done
121
- - name: Deploy
122
- id: deploy
123
- timeout-minutes: 10
124
- env:
125
- TRUSTED: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
126
- CONVEX_DEPLOY_KEY: ${{ secrets[github.event_name == 'push' && 'CONVEX_DEPLOY_KEY' || 'CONVEX_DEPLOY_KEY_PREVIEW'] }}
127
- run: |
128
- if [[ "$TRUSTED" != true ]]; then VITE_CONVEX_URL=https://ci.invalid VITE_CONVEX_SITE_URL=https://ci.invalid bun run build --filter=@disposabl/web; exit; fi
129
- : "${CONVEX_DEPLOY_KEY:?Configure the Convex deployment secret for this repository}"
130
- cd packages/backend
131
- export AUTH_TARGET=--prod
132
- target=()
133
- if [[ "$CHANNEL" != production ]]; then export AUTH_TARGET="--preview-name $CHANNEL"; target=(--preview-name "$CHANNEL"); fi
134
- bun x --no-install convex deploy --yes "${target[@]}" --cmd-url-env-var-name CONVEX_URL --cmd 'for name in CONVEX_URL CONVEX_SITE_URL; do value=$(printenv "$name"); test -n "$value" || exit 1; for prefix in "" VITE_ EXPO_PUBLIC_; do export "$prefix$name=$value"; printf "%s=%s\n" "$prefix$name" "$value" | tee -a "$GITHUB_ENV" >> "$GITHUB_OUTPUT"; done; done; bun run --cwd ../.. build --filter=@disposabl/web'
135
- setup_target=(--prod)
136
- if [[ "$CHANNEL" != production ]]; then setup_target=("${target[@]}"); fi
137
- bun x --no-install convex run "${setup_target[@]}" billing:setup '{}'
138
- bun x --no-install static-hosting upload $AUTH_TARGET --no-spa --dist ../../apps/web/dist/client
139
- - name: Report web result
140
- if: always()
141
- run: node .github/scripts/disposabl.mjs report web,api,mcp ${{ steps.deploy.outcome == 'success' && 'ready' || 'failed' }}
142
- - name: Expo
143
- if: needs.changes.outputs.android == 'true'
144
- working-directory: apps/mobile
145
- run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-env
146
- - name: Channel
147
- if: needs.changes.outputs.android == 'true'
148
- working-directory: apps/mobile
149
- run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-channel
150
- - name: Fingerprint
151
- id: fingerprint
152
- if: needs.changes.outputs.android == 'true'
153
- working-directory: apps/mobile
154
- run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-fingerprint
155
- - name: Update
156
- if: steps.fingerprint.outputs.build == 'false'
157
- env:
158
- TAG: ${{ steps.fingerprint.outputs.tag }}
159
- SHA: ${{ steps.fingerprint.outputs.sha }}
160
- RUNTIME: ${{ steps.fingerprint.outputs.runtime }}
161
- run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-update
162
- - &publish
163
- name: Publish
164
- if: github.job == 'android' || (github.job == 'web' && hashFiles('dist/release/android.json') != '') || github.job == 'desktop'
165
- shell: bash
166
- run: bash "$GITHUB_WORKSPACE/.github/scripts/release.sh" verify-artifacts
167
- - &artifacts
168
- name: Upload release artifacts
169
- id: artifacts
170
- if: hashFiles('dist/release/*') != ''
171
- uses: actions/upload-artifact@v4
172
- with:
173
- name: release-${{ env.PLATFORM }}
174
- path: dist/release/
175
- retention-days: 3
176
- compression-level: 0
177
- if-no-files-found: error
178
- android:
179
- name: Android
180
- needs: [changes, web]
181
- if: needs.web.outputs.android_build == 'true'
182
- permissions: *release-permissions
183
- runs-on: ${{ needs.changes.outputs.android_runner }}
184
- timeout-minutes: 20
185
- env:
186
- PLATFORM: android
187
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
188
- EXPO_PROJECT_ID: ${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}
189
- EXPO_OWNER: ${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}
190
- EXPO_SLUG: ${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}
191
- EXPO_NO_DOTENV: "1"
192
- CONVEX_URL: ${{ needs.web.outputs.convex_url }}
193
- CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
194
- EXPO_PUBLIC_CONVEX_URL: ${{ needs.web.outputs.convex_url }}
195
- EXPO_PUBLIC_CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
196
- steps:
197
- - *checkout
198
- - name: Prepare Android disk space
199
- run: bash .github/scripts/android-runner.sh prepare
200
- - *node
201
- - *bun
202
- - *cache
203
- - *install
204
- - name: Report mobile build
205
- run: node .github/scripts/disposabl.mjs report "$PLATFORM" building
206
- - name: Expo
207
- working-directory: apps/mobile
208
- run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-env
209
- - name: Java
210
- uses: actions/setup-java@v5
211
- with: { distribution: temurin, java-version: "17" }
212
- - name: SDK
213
- uses: android-actions/setup-android@v3
214
- with: { packages: platform-tools }
215
- - name: Gradle
216
- uses: gradle/actions/setup-gradle@v4
217
- with: { cache-read-only: false }
218
- - name: Restore native compiler cache
219
- if: github.event_name == 'push'
220
- id: native-cache
221
- uses: actions/cache/restore@v4
222
- with:
223
- path: ${{ runner.temp }}/ccache
224
- key: android-ccache-v1-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}
225
- - name: Install native compiler cache
226
- if: github.event_name == 'push' && steps.native-cache.outputs.cache-hit == 'true'
227
- run: |
228
- sudo apt-get update -qq
229
- sudo apt-get install -y ccache
230
- printf 'CCACHE_DIR=%s\nCCACHE_COMPILERCHECK=content\nCMAKE_C_COMPILER_LAUNCHER=ccache\nCMAKE_CXX_COMPILER_LAUNCHER=ccache\n' "$RUNNER_TEMP/ccache" >> "$GITHUB_ENV"
231
- - name: Build
232
- working-directory: apps/mobile
233
- env:
234
- RUNTIME: ${{ needs.web.outputs.android_runtime }}
235
- DISPOSABL_ANDROID_CHANNEL: *channel
236
- DISPOSABL_ANDROID_SIGNING: ${{ github.event_name == 'push' && secrets.DISPOSABL_ANDROID_SIGNING || '' }}
237
- ANDROID_KEYSTORE_BASE64: ${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}
238
- ANDROID_KEYSTORE_PASSWORD: ${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}
239
- ANDROID_KEY_ALIAS: ${{ github.event_name == 'push' && secrets.ANDROID_KEY_ALIAS || '' }}
240
- ANDROID_KEY_PASSWORD: ${{ github.event_name == 'push' && secrets.ANDROID_KEY_PASSWORD || '' }}
241
- run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" android-build
242
- - *publish
243
- - *artifacts
244
- android-failure:
245
- name: Report Android failure
246
- needs: android
247
- if: always() && (needs.android.result == 'failure' || needs.android.result == 'cancelled')
248
- permissions:
249
- contents: read
250
- id-token: write
251
- runs-on: *linux-runner
252
- timeout-minutes: 5
253
- steps:
254
- - *checkout
255
- - *node
256
- - run: node .github/scripts/disposabl.mjs report android failed "Android build failed or was cancelled; check the workflow log."
257
- ios-preview:
258
- name: iOS simulator preview
259
- needs: [changes, web]
260
- if: github.event_name == 'pull_request' && needs.web.outputs.ios == 'true'
261
- permissions: *release-permissions
262
- runs-on: ${{ needs.changes.outputs.macos_runner }}
263
- timeout-minutes: 20
264
- env:
265
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
266
- CONVEX_URL: ${{ needs.web.outputs.convex_url }}
267
- CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
268
- EXPO_PUBLIC_CONVEX_URL: ${{ needs.web.outputs.convex_url }}
269
- EXPO_PUBLIC_CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
270
- EXPO_PROJECT_ID: ${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}
271
- EXPO_OWNER: ${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}
272
- EXPO_SLUG: ${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}
273
- EXPO_NO_DOTENV: "1"
274
- steps:
275
- - *checkout
276
- - *node
277
- - *bun
278
- - *cache
279
- - *install
280
- - name: Report build
281
- run: node .github/scripts/disposabl.mjs report ios building
282
- - name: Load Expo environment
283
- if: env.EXPO_TOKEN != ''
284
- working-directory: apps/mobile
285
- run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-env
286
- - name: Verify update channel
287
- if: env.EXPO_TOKEN != ''
288
- working-directory: apps/mobile
289
- run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-channel
290
- - name: Publish compatible iOS preview update
291
- if: env.EXPO_TOKEN != ''
292
- working-directory: apps/mobile
293
- run: bash "$GITHUB_WORKSPACE/.github/scripts/apple.sh" ota
294
- - name: Xcode toolchain
295
- run: |
296
- xcodebuild -version
297
- xcrun swift --version
298
- - name: Build simulator archive
299
- working-directory: apps/mobile
300
- run: bash "$GITHUB_WORKSPACE/.github/scripts/apple.sh" simulator
301
- - uses: actions/upload-artifact@v4
302
- with:
303
- name: ios-simulator
304
- path: dist/apple/ios-simulator.zip
305
- retention-days: 3
306
- compression-level: 0
307
- if-no-files-found: error
308
- - name: Report simulator archive
309
- run: |
310
- echo 'iOS simulator archive is available in this workflow run’s artifacts; it is not a device or TestFlight build.' >> "$GITHUB_STEP_SUMMARY"
311
- node .github/scripts/disposabl.mjs report ios ready 'Simulator archive available in workflow artifacts.'
312
- - name: Report failure
313
- if: failure() || cancelled()
314
- run: node .github/scripts/disposabl.mjs report ios failed 'iOS simulator build failed; check the workflow log.'
315
- ios-production:
316
- name: iOS production and TestFlight
317
- needs: [changes, web]
318
- if: github.event_name == 'push' && needs.web.outputs.ios == 'true'
319
- permissions: *release-permissions
320
- runs-on: ${{ needs.changes.outputs.linux_runner }}
321
- timeout-minutes: 20
322
- env:
323
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
324
- EXPO_PROJECT_ID: ${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}
325
- EXPO_OWNER: ${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}
326
- EXPO_SLUG: ${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}
327
- EXPO_NO_DOTENV: "1"
328
- CONVEX_URL: ${{ needs.web.outputs.convex_url }}
329
- CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
330
- EXPO_PUBLIC_CONVEX_URL: ${{ needs.web.outputs.convex_url }}
331
- EXPO_PUBLIC_CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
332
- steps:
333
- - *checkout
334
- - *node
335
- - *bun
336
- - *cache
337
- - *install
338
- - name: Check Expo connection
339
- id: apple-prerequisites
340
- working-directory: apps/mobile
341
- run: bash "$GITHUB_WORKSPACE/.github/scripts/apple.sh" prerequisites
342
- - name: Load Expo environment
343
- if: steps.apple-prerequisites.outputs.ready == 'true'
344
- working-directory: apps/mobile
345
- run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-env
346
- - name: Verify update channel
347
- if: steps.apple-prerequisites.outputs.ready == 'true'
348
- working-directory: apps/mobile
349
- run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-channel
350
- - name: Select iOS update or native build
351
- id: ios-plan
352
- if: steps.apple-prerequisites.outputs.ready == 'true'
353
- working-directory: apps/mobile
354
- run: bash "$GITHUB_WORKSPACE/.github/scripts/apple.sh" ota-plan
355
- - name: Publish compatible iOS production update
356
- if: steps.ios-plan.outputs.action == 'update'
357
- working-directory: apps/mobile
358
- env:
359
- RUNTIME: ${{ steps.ios-plan.outputs.runtime }}
360
- run: bash "$GITHUB_WORKSPACE/.github/scripts/apple.sh" ota
361
- - name: Build and submit to TestFlight
362
- if: steps.ios-plan.outputs.action == 'build'
363
- working-directory: apps/mobile
364
- env:
365
- ASC_APP_ID: ${{ secrets.ASC_APP_ID || vars.ASC_APP_ID }}
366
- run: bash "$GITHUB_WORKSPACE/.github/scripts/apple.sh" production
367
- - name: Reconcile delivery of the compatible native build
368
- if: steps.ios-plan.outputs.action == 'update'
369
- working-directory: apps/mobile
370
- env:
371
- BUILD_ID: ${{ steps.ios-plan.outputs.build_id }}
372
- ASC_APP_ID: ${{ secrets.ASC_APP_ID || vars.ASC_APP_ID }}
373
- run: bash "$GITHUB_WORKSPACE/.github/scripts/apple.sh" deliver
374
- - name: Report failure
375
- if: failure() || cancelled()
376
- run: node .github/scripts/disposabl.mjs report ios failed 'iOS update, native build or submission failed; check the workflow log.'
377
- desktop:
378
- needs: web
379
- permissions: *release-permissions
380
- name: ${{ matrix.platform }}
381
- if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.web.outputs.desktop != '[]' && needs.web.outputs.desktop != ''
382
- strategy:
383
- fail-fast: false
384
- matrix:
385
- include: ${{ fromJSON(needs.web.outputs.desktop) }}
386
- runs-on: ${{ matrix.runner }}
387
- timeout-minutes: 20
388
- env:
389
- PLATFORM: ${{ matrix.platform }}
390
- DISPOSABL_RELEASE_VERSION: 1.${{ github.run_number }}.${{ github.run_attempt }}
391
- DISPOSABL_DESKTOP_PLATFORM: ${{ matrix.platform }}
392
- DISPOSABL_DESKTOP_UPDATE_CHANNEL: production
393
- CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
394
- electron_config_cache: ${{ github.workspace }}/.cache/electron
395
- steps:
396
- - *checkout
397
- - *node
398
- - *bun
399
- - *cache
400
- - *install
401
- - name: Report desktop build
402
- run: node .github/scripts/disposabl.mjs report "$PLATFORM" building
403
- - name: Electron
404
- uses: actions/cache@v4
405
- with:
406
- path: .cache/electron
407
- key: electron-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('bun.lock') }}
408
- - name: Packages
409
- if: matrix.platform == 'linux'
410
- run: command -v fakeroot && command -v rpmbuild && command -v dpkg-deb || { sudo apt-get update && sudo apt-get install -y fakeroot dpkg rpm; }
411
- - name: Configure desktop update identity
412
- shell: bash
413
- run: |
414
- id=$(node -p "require('./disposabl.json').desktopId || ''")
415
- if [[ ! "$id" =~ ^[a-f0-9]{32}$ ]]; then echo 'Desktop identity missing; regenerate this app before its first installation.' >&2; exit 1; fi
416
- echo "DISPOSABL_DESKTOP_ID=$id" >> "$GITHUB_ENV"
417
- echo "DISPOSABL_DESKTOP_UPDATE_URL=${CONVEX_SITE_URL}/desktop/updates/$id" >> "$GITHUB_ENV"
418
- - name: Build
419
- if: matrix.platform != 'macos'
420
- run: bun run --cwd apps/desktop preview
421
- - name: Build macOS
422
- if: matrix.platform == 'macos'
423
- shell: bash
424
- env:
425
- MACOS_SIGNING_CONFIG: ${{ secrets.MACOS_SIGNING_CONFIG }}
426
- run: bash .github/scripts/macos-release.sh
427
- - *publish
428
- - name: Publish desktop update feed
429
- if: matrix.platform == 'windows' || (matrix.platform == 'macos' && env.MACOS_NOTARIZE == 'true')
430
- shell: bash
431
- env:
432
- CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }}
433
- run: |
434
- test "$(gh api "repos/$GH_REPO/git/ref/heads/main" --jq .object.sha)" = "$SOURCE"
435
- node apps/desktop/publish-update.mjs
436
- - name: Upload desktop release artifacts
437
- if: matrix.platform != 'macos' || env.MACOS_NOTARIZE == 'true'
438
- uses: actions/upload-artifact@v4
439
- with:
440
- name: release-${{ env.PLATFORM }}
441
- path: dist/release/
442
- retention-days: 3
443
- compression-level: 0
444
- if-no-files-found: error
445
- - name: Upload staged update feed
446
- if: matrix.platform != 'linux' && env.DISPOSABL_DESKTOP_UPDATE_URL != '' && (matrix.platform != 'macos' || env.MACOS_NOTARIZE == 'true')
447
- uses: actions/upload-artifact@v4
448
- with:
449
- name: desktop-update-${{ env.PLATFORM }}
450
- path: dist/update/
451
- retention-days: 3
452
- if-no-files-found: error
453
- - name: Upload unsigned macOS artifact
454
- if: matrix.platform == 'macos' && env.MACOS_NOTARIZE != 'true'
455
- uses: actions/upload-artifact@v4
456
- with:
457
- name: macos-unsigned
458
- path: |
459
- dist/release/*.dmg
460
- dist/release/*.zip
461
- retention-days: 3
462
- compression-level: 0
463
- if-no-files-found: error
464
- - name: Report macOS artifact
465
- if: matrix.platform == 'macos' && env.MACOS_NOTARIZE != 'true'
466
- run: |
467
- echo 'macOS DMG is ad-hoc signed, not Developer ID signed or notarized. Download it from this workflow run’s artifacts.' >> "$GITHUB_STEP_SUMMARY"
468
- node .github/scripts/disposabl.mjs report macos blocked 'Ad-hoc signed DMG available in workflow artifacts; Developer ID signing and notarization are not configured.'
469
- - name: Report desktop failure
470
- if: failure() || cancelled()
471
- run: node .github/scripts/disposabl.mjs report "$PLATFORM" failed
472
- - name: Clean up macOS signing
473
- if: always() && matrix.platform == 'macos'
474
- shell: bash
475
- run: bash .github/scripts/macos-release.sh cleanup
476
- packages:
477
- name: Package / ${{ matrix.package }}
478
- needs: [changes, web]
479
- if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.web.outputs.packages != '[]' && needs.web.outputs.packages != ''
480
- runs-on: ${{ needs.changes.outputs.linux_runner }}
481
- timeout-minutes: 15
482
- permissions:
483
- contents: write
484
- id-token: write
485
- concurrency:
486
- group: npm-${{ matrix.package }}
487
- cancel-in-progress: false
488
- strategy:
489
- fail-fast: false
490
- matrix:
491
- package: ${{ fromJSON(needs.web.outputs.packages) }}
492
- env:
493
- PACKAGE: ${{ matrix.package }}
494
- steps:
495
- - uses: actions/checkout@v6
496
- with: { fetch-depth: 0, persist-credentials: false }
497
- - *node
498
- - *bun
499
- - *cache
500
- - *install
501
- - name: Disposabl GitHub App token
502
- run: node .github/scripts/disposabl.mjs token
503
- - name: Publish package if configured
504
- run: bash .github/scripts/release.sh package-release
505
-
506
- # The publisher executes scripts from main only; the authorizer verifies workflow_sha.
507
- publish:
508
- needs: [changes, web, android, desktop]
509
- if: always() && !cancelled() && needs.web.result == 'success' && (needs.web.outputs.release == 'true' || needs.android.result == 'success' || needs.desktop.result == 'success')
510
- environment: publishing
511
- runs-on: ${{ needs.changes.outputs.linux_runner }}
512
- timeout-minutes: 15
513
- permissions:
514
- contents: write
515
- actions: read
516
- id-token: write
517
- steps:
518
- - uses: actions/checkout@v6
519
- with:
520
- ref: main
521
- persist-credentials: false
522
- - uses: actions/setup-node@v6
523
- with:
524
- node-version: "24"
525
- package-manager-cache: false
526
- - name: Disposabl installation token
527
- run: node .github/scripts/disposabl.mjs token
528
- - name: Select release source
529
- id: source
530
- run: bash .github/scripts/release.sh release-source
531
- - uses: actions/download-artifact@v4
532
- if: steps.source.outputs.current == 'true'
533
- with:
534
- pattern: release-*
535
- path: artifacts
536
- - name: Publish verified build artifacts
537
- if: steps.source.outputs.current == 'true'
538
- run: bash .github/scripts/release.sh release-publish
1
+ {name: Pipeline,"on": {pull_request: {branches: [main]},push: {branches: [main]}},permissions: {contents: read,pull-requests: read},concurrency: {group: "${{ github.workflow }}-${{ github.ref }}",cancel-in-progress: "${{ github.event_name == 'pull_request' }}"},env: {CHANNEL: "${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'production' }}",DISPOSABL_MOBILE_CHANNEL: "${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'production' }}",EAS_ENVIRONMENT: "${{ github.event_name == 'push' && 'production' || 'preview' }}",EAS_CLI: eas-cli@27.2.0,BUN_VERSION: 1.4.4,NODE_VERSION: "24",LINUX_RUNNER: ubuntu-24.04,WEB_RUNNER: ubuntu-24.04,WINDOWS_RUNNER: windows-2025,MACOS_RUNNER: macos-26,RELEASE_PREFIX: app,DISPOSABL_ANDROID_VERSION_CODE: "${{ github.run_number }}",DISPOSABL_IOS_BUILD_NUMBER: "${{ github.run_number }}",GH_TOKEN: "${{ github.token }}",GH_REPO: "${{ github.repository }}",SOURCE: "${{ github.event.pull_request.head.sha || github.sha }}",SOURCE_PATH: "${{ github.event_name == 'pull_request' && format('pulls/{0}', github.event.number) || 'git/ref/heads/main' }}",DISPOSABL_RELEASE_VERSION: "1.0.${{ github.run_number }}"},jobs: {changes: {name: Select work,if: "github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository",permissions: {contents: read,pull-requests: read,actions: read},runs-on: ubuntu-24.04,timeout-minutes: 5,outputs: {linux_runner: "${{ steps.platforms.outputs.linux_runner }}",android_runner: "${{ steps.platforms.outputs.android_runner }}",macos_runner: "${{ steps.platforms.outputs.macos_runner }}",changed: "${{ steps.platforms.outputs.changed }}",android: "${{ steps.platforms.outputs.android }}",ios: "${{ steps.platforms.outputs.ios }}",desktop: "${{ steps.platforms.outputs.desktop }}",packages: "${{ steps.platforms.outputs.packages }}"},steps: [&item0 {uses: actions/checkout@v6,with: {ref: "${{ env.SOURCE }}",persist-credentials: false}},{name: Select affected platforms,shell: bash,id: platforms,env: {PR: "${{ github.event.number }}",EXPO_CONNECTED: "${{ secrets.EXPO_TOKEN != '' }}",IOS_BUILDS_ENABLED: "${{ vars.IOS_BUILDS_ENABLED != 'false' }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/platforms.sh\""}]},web: {name: Web,needs: changes,if: "needs.changes.outputs.changed == 'true'",permissions: &permissions {contents: read,pull-requests: read,id-token: write},timeout-minutes: 20,runs-on: "${{ needs.changes.outputs.linux_runner }}",outputs: {desktop: "${{ needs.changes.outputs.desktop }}",ios: "${{ needs.changes.outputs.ios }}",packages: "${{ needs.changes.outputs.packages }}",release: "${{ steps.artifacts.outcome == 'success' }}",android_build: "${{ steps.fingerprint.outputs.build }}",android_runtime: "${{ steps.fingerprint.outputs.runtime }}",convex_url: "${{ steps.deploy.outputs.CONVEX_URL }}",convex_site_url: "${{ steps.deploy.outputs.CONVEX_SITE_URL }}"},env: {PLATFORM: android,ANDROID_SIGNING_READY: "${{ secrets.DISPOSABL_ANDROID_SIGNING != '' || (secrets.ANDROID_KEYSTORE_BASE64 != '' && secrets.ANDROID_KEYSTORE_PASSWORD != '' && secrets.ANDROID_KEY_ALIAS != '' && secrets.ANDROID_KEY_PASSWORD != '') }}",EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1"},steps: [*item0,&item1 {uses: actions/setup-node@v6,with: {node-version: "24",package-manager-cache: false}},&item2 {uses: oven-sh/setup-bun@v2,with: {bun-version: 1.4.4}},&item3 {uses: actions/cache@v4,with: {path: ~/.bun/install/cache,key: "bun-${{ github.job == 'desktop' && 'desktop-' || '' }}${{ runner.os }}-${{ runner.arch }}-${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }}",restore-keys: "bun-${{ github.job == 'desktop' && 'desktop-' || '' }}${{ runner.os }}-${{ runner.arch }}-${{ env.BUN_VERSION }}-"}},&item4 {run: "bun install --frozen-lockfile ${{ github.job == 'desktop' && '--filter \"*desktop*\" --filter @disposabl/backend' || (github.job == 'android' || startsWith(github.job, 'ios-')) && '--filter @disposabl/mobile' || '' }}"},{name: Report build start,run: "node .github/scripts/disposabl.mjs report web,api,mcp building\nif [[ -z \"$EXPO_TOKEN\" ]]; then node .github/scripts/disposabl.mjs report android blocked 'Connect Expo before building Android.'; fi\nif [[ '${{ github.event_name }}' == pull_request ]]; then node .github/scripts/disposabl.mjs report cli,typescript-sdk blocked 'Packages publish after merge to main.'; fi\n"},{name: Check,run: bun run check},{name: Build selected clients,run: "for package in cli sdk; do\n if test -f \"packages/$package/package.json\"; then bun run --cwd \"packages/$package\" build; fi\ndone\n"},{name: Deploy,id: deploy,timeout-minutes: 10,env: {TRUSTED: "${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}",CONVEX_DEPLOY_KEY: "${{ secrets[github.event_name == 'push' && 'CONVEX_DEPLOY_KEY' || 'CONVEX_DEPLOY_KEY_PREVIEW'] }}"},run: "if [[ \"$TRUSTED\" != true ]]; then VITE_CONVEX_URL=https://ci.invalid VITE_CONVEX_SITE_URL=https://ci.invalid bun run build --filter=@disposabl/web; exit; fi\n: \"${CONVEX_DEPLOY_KEY:?Configure the Convex deployment secret for this repository}\"\ncd packages/backend\nexport AUTH_TARGET=--prod\ntarget=()\nif [[ \"$CHANNEL\" != production ]]; then export AUTH_TARGET=\"--preview-name $CHANNEL\"; target=(--preview-name \"$CHANNEL\"); fi\nbun x --no-install convex deploy --yes \"${target[@]}\" --cmd-url-env-var-name CONVEX_URL --cmd 'for name in CONVEX_URL CONVEX_SITE_URL; do value=$(printenv \"$name\"); test -n \"$value\" || exit 1; for prefix in \"\" VITE_ EXPO_PUBLIC_; do export \"$prefix$name=$value\"; printf \"%s=%s\\n\" \"$prefix$name\" \"$value\" | tee -a \"$GITHUB_ENV\" >> \"$GITHUB_OUTPUT\"; done; done; bun run --cwd ../.. build --filter=@disposabl/web'\nsetup_target=(--prod)\nif [[ \"$CHANNEL\" != production ]]; then setup_target=(\"${target[@]}\"); fi\nbun x --no-install convex run \"${setup_target[@]}\" billing:setup '{}'\nbun x --no-install static-hosting upload $AUTH_TARGET --no-spa --dist ../../apps/web/dist/client\n"},{name: Report web result,if: always(),run: "node .github/scripts/disposabl.mjs report web,api,mcp ${{ steps.deploy.outcome == 'success' && 'ready' || 'failed' }}"},{name: Expo,if: "needs.changes.outputs.android == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Channel,if: "needs.changes.outputs.android == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-channel"},{name: Fingerprint,id: fingerprint,if: "needs.changes.outputs.android == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-fingerprint"},{name: Update,if: "steps.fingerprint.outputs.build == 'false'",env: {TAG: "${{ steps.fingerprint.outputs.tag }}",SHA: "${{ steps.fingerprint.outputs.sha }}",RUNTIME: "${{ steps.fingerprint.outputs.runtime }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-update"},&item5 {name: Publish,if: "github.job == 'android' || (github.job == 'web' && hashFiles('dist/release/android.json') != '') || github.job == 'desktop'",shell: bash,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/release.sh\" verify-artifacts"},&item6 {name: Upload release artifacts,id: artifacts,if: "hashFiles('dist/release/*') != ''",uses: actions/upload-artifact@v4,with: {name: "release-${{ env.PLATFORM }}",path: dist/release/,retention-days: 3,compression-level: 0,if-no-files-found: error}}]},android: {name: Android,needs: [changes,web],if: "needs.web.outputs.android_build == 'true'",permissions: *permissions,runs-on: "${{ needs.changes.outputs.android_runner }}",timeout-minutes: 30,env: {PLATFORM: android,EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1",CONVEX_URL: "${{ needs.web.outputs.convex_url }}",CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PUBLIC_CONVEX_URL: "${{ needs.web.outputs.convex_url }}",EXPO_PUBLIC_CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}"},steps: [*item0,{name: Prepare Android disk space,run: bash .github/scripts/android-runner.sh prepare},*item1,*item2,*item3,*item4,{name: Report mobile build,run: "node .github/scripts/disposabl.mjs report \"$PLATFORM\" building"},{name: Expo,working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Java,uses: actions/setup-java@v5,with: {distribution: temurin,java-version: "17"}},{name: SDK,uses: android-actions/setup-android@v3,with: {packages: platform-tools}},{name: Gradle,uses: gradle/actions/setup-gradle@v4,with: {cache-read-only: false}},{name: Restore native compiler cache,if: "github.event_name == 'push'",id: native-cache,uses: actions/cache/restore@v4,with: {path: "${{ runner.temp }}/ccache",key: "android-ccache-v1-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}"}},{name: Install native compiler cache,if: "github.event_name == 'push' && steps.native-cache.outputs.cache-hit == 'true'",run: "sudo apt-get update -qq\nsudo apt-get install -y ccache\nprintf 'CCACHE_DIR=%s\\nCCACHE_COMPILERCHECK=content\\nCMAKE_C_COMPILER_LAUNCHER=ccache\\nCMAKE_CXX_COMPILER_LAUNCHER=ccache\\n' \"$RUNNER_TEMP/ccache\" >> \"$GITHUB_ENV\"\n"},{name: Build,working-directory: apps/mobile,env: {RUNTIME: "${{ needs.web.outputs.android_runtime }}",DISPOSABL_ANDROID_CHANNEL: "${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'production' }}",DISPOSABL_ANDROID_SIGNING: "${{ github.event_name == 'push' && secrets.DISPOSABL_ANDROID_SIGNING || '' }}",ANDROID_KEYSTORE_BASE64: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}",ANDROID_KEYSTORE_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}",ANDROID_KEY_ALIAS: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_ALIAS || '' }}",ANDROID_KEY_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_PASSWORD || '' }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" android-build"},*item5,*item6]},android-failure: {name: Report Android failure,needs: android,if: "always() && (needs.android.result == 'failure' || needs.android.result == 'cancelled')",permissions: {contents: read,id-token: write},runs-on: ubuntu-24.04,timeout-minutes: 5,steps: [*item0,*item1,{run: "node .github/scripts/disposabl.mjs report android failed \"Android build failed or was cancelled; check the workflow log.\""}]},ios-preview: {name: iOS simulator preview,needs: [changes,web],if: "github.event_name == 'pull_request' && needs.web.outputs.ios == 'true'",permissions: *permissions,runs-on: "${{ needs.changes.outputs.macos_runner }}",timeout-minutes: 20,env: {EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",CONVEX_URL: "${{ needs.web.outputs.convex_url }}",CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PUBLIC_CONVEX_URL: "${{ needs.web.outputs.convex_url }}",EXPO_PUBLIC_CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1"},steps: [*item0,*item1,*item2,*item3,*item4,{name: Report build,run: node .github/scripts/disposabl.mjs report ios building},{name: Load Expo environment,if: "env.EXPO_TOKEN != ''",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Verify update channel,if: "env.EXPO_TOKEN != ''",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-channel"},{name: Publish compatible iOS preview update,if: "env.EXPO_TOKEN != ''",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" ota"},{name: Xcode toolchain,run: "xcodebuild -version\nxcrun swift --version\n"},{name: Build simulator archive,working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" simulator"},{uses: actions/upload-artifact@v4,with: {name: ios-simulator,path: dist/apple/ios-simulator.zip,retention-days: 3,compression-level: 0,if-no-files-found: error}},{name: Report simulator archive,run: "echo 'iOS simulator archive is available in this workflow run’s artifacts; it is not a device or TestFlight build.' >> \"$GITHUB_STEP_SUMMARY\"\nnode .github/scripts/disposabl.mjs report ios ready 'Simulator archive available in workflow artifacts.'\n"},{name: Report failure,if: failure() || cancelled(),run: "node .github/scripts/disposabl.mjs report ios failed 'iOS simulator build failed; check the workflow log.'"}]},ios-production: {name: iOS production and TestFlight,needs: [changes,web],if: "github.event_name == 'push' && needs.web.outputs.ios == 'true'",permissions: *permissions,runs-on: "${{ needs.changes.outputs.linux_runner }}",timeout-minutes: 20,env: {EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1",CONVEX_URL: "${{ needs.web.outputs.convex_url }}",CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PUBLIC_CONVEX_URL: "${{ needs.web.outputs.convex_url }}",EXPO_PUBLIC_CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}"},steps: [*item0,*item1,*item2,*item3,*item4,{name: Check Expo connection,id: apple-prerequisites,working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" prerequisites"},{name: Load Expo environment,if: "steps.apple-prerequisites.outputs.ready == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Verify update channel,if: "steps.apple-prerequisites.outputs.ready == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-channel"},{name: Select iOS update or native build,id: ios-plan,if: "steps.apple-prerequisites.outputs.ready == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" ota-plan"},{name: Publish compatible iOS production update,if: "steps.ios-plan.outputs.action == 'update'",working-directory: apps/mobile,env: {RUNTIME: "${{ steps.ios-plan.outputs.runtime }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" ota"},{name: Build and submit to TestFlight,if: "steps.ios-plan.outputs.action == 'build'",working-directory: apps/mobile,env: {ASC_APP_ID: "${{ secrets.ASC_APP_ID || vars.ASC_APP_ID }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" production"},{name: Reconcile delivery of the compatible native build,if: "steps.ios-plan.outputs.action == 'update'",working-directory: apps/mobile,env: {BUILD_ID: "${{ steps.ios-plan.outputs.build_id }}",ASC_APP_ID: "${{ secrets.ASC_APP_ID || vars.ASC_APP_ID }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" deliver"},{name: Report failure,if: failure() || cancelled(),run: "node .github/scripts/disposabl.mjs report ios failed 'iOS update, native build or submission failed; check the workflow log.'"}]},desktop: {needs: web,permissions: *permissions,name: "${{ matrix.platform }}",if: "github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.web.outputs.desktop != '[]' && needs.web.outputs.desktop != ''",strategy: {fail-fast: false,matrix: {include: "${{ fromJSON(needs.web.outputs.desktop) }}"}},runs-on: "${{ matrix.runner }}",timeout-minutes: 20,env: {PLATFORM: "${{ matrix.platform }}",DISPOSABL_RELEASE_VERSION: "1.${{ github.run_number }}.${{ github.run_attempt }}",DISPOSABL_DESKTOP_PLATFORM: "${{ matrix.platform }}",DISPOSABL_DESKTOP_UPDATE_CHANNEL: production,CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",electron_config_cache: "${{ github.workspace }}/.cache/electron"},steps: [*item0,*item1,*item2,*item3,*item4,{name: Report desktop build,run: "node .github/scripts/disposabl.mjs report \"$PLATFORM\" building"},{name: Electron,uses: actions/cache@v4,with: {path: .cache/electron,key: "electron-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('bun.lock') }}"}},{name: Packages,if: "matrix.platform == 'linux'",run: "command -v fakeroot && command -v rpmbuild && command -v dpkg-deb || { sudo apt-get update && sudo apt-get install -y fakeroot dpkg rpm; }"},{name: Configure desktop update identity,shell: bash,run: "id=$(node -p \"require('./disposabl.json').desktopId || ''\")\nif [[ ! \"$id\" =~ ^[a-f0-9]{32}$ ]]; then echo 'Desktop identity missing; regenerate this app before its first installation.' >&2; exit 1; fi\necho \"DISPOSABL_DESKTOP_ID=$id\" >> \"$GITHUB_ENV\"\necho \"DISPOSABL_DESKTOP_UPDATE_URL=${CONVEX_SITE_URL}/desktop/updates/$id\" >> \"$GITHUB_ENV\"\n"},{name: Build,if: "matrix.platform != 'macos'",run: bun run --cwd apps/desktop preview},{name: Build macOS,if: "matrix.platform == 'macos'",shell: bash,env: {MACOS_SIGNING_CONFIG: "${{ secrets.MACOS_SIGNING_CONFIG }}"},run: bash .github/scripts/macos-release.sh},*item5,{name: Publish desktop update feed,if: "matrix.platform == 'windows' || (matrix.platform == 'macos' && env.MACOS_NOTARIZE == 'true')",shell: bash,env: {CONVEX_DEPLOY_KEY: "${{ secrets.CONVEX_DEPLOY_KEY }}"},run: "test \"$(gh api \"repos/$GH_REPO/git/ref/heads/main\" --jq .object.sha)\" = \"$SOURCE\"\nnode apps/desktop/publish-update.mjs\n"},{name: Upload desktop release artifacts,if: "matrix.platform != 'macos' || env.MACOS_NOTARIZE == 'true'",uses: actions/upload-artifact@v4,with: {name: "release-${{ env.PLATFORM }}",path: dist/release/,retention-days: 3,compression-level: 0,if-no-files-found: error}},{name: Upload staged update feed,if: "matrix.platform != 'linux' && env.DISPOSABL_DESKTOP_UPDATE_URL != '' && (matrix.platform != 'macos' || env.MACOS_NOTARIZE == 'true')",uses: actions/upload-artifact@v4,with: {name: "desktop-update-${{ env.PLATFORM }}",path: dist/update/,retention-days: 3,if-no-files-found: error}},{name: Upload unsigned macOS artifact,if: "matrix.platform == 'macos' && env.MACOS_NOTARIZE != 'true'",uses: actions/upload-artifact@v4,with: {name: macos-unsigned,path: "dist/release/*.dmg\ndist/release/*.zip\n",retention-days: 3,compression-level: 0,if-no-files-found: error}},{name: Report macOS artifact,if: "matrix.platform == 'macos' && env.MACOS_NOTARIZE != 'true'",run: "echo 'macOS DMG is ad-hoc signed, not Developer ID signed or notarized. Download it from this workflow run’s artifacts.' >> \"$GITHUB_STEP_SUMMARY\"\nnode .github/scripts/disposabl.mjs report macos blocked 'Ad-hoc signed DMG available in workflow artifacts; Developer ID signing and notarization are not configured.'\n"},{name: Report desktop failure,if: failure() || cancelled(),run: "node .github/scripts/disposabl.mjs report \"$PLATFORM\" failed"},{name: Clean up macOS signing,if: "always() && matrix.platform == 'macos'",shell: bash,run: bash .github/scripts/macos-release.sh cleanup}]},packages: {name: "Package / ${{ matrix.package }}",needs: [changes,web],if: "github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.web.outputs.packages != '[]' && needs.web.outputs.packages != ''",runs-on: "${{ needs.changes.outputs.linux_runner }}",timeout-minutes: 15,permissions: {contents: write,id-token: write},concurrency: {group: "npm-${{ matrix.package }}",cancel-in-progress: false},strategy: {fail-fast: false,matrix: {package: "${{ fromJSON(needs.web.outputs.packages) }}"}},env: {PACKAGE: "${{ matrix.package }}"},steps: [{uses: actions/checkout@v6,with: {fetch-depth: 0,persist-credentials: false}},*item1,*item2,*item3,*item4,{name: Disposabl GitHub App token,run: node .github/scripts/disposabl.mjs token},{name: Publish package if configured,run: bash .github/scripts/release.sh package-release}]},publish: {needs: [changes,web,android,desktop],if: "always() && !cancelled() && needs.web.result == 'success' && (needs.web.outputs.release == 'true' || needs.android.result == 'success' || needs.desktop.result == 'success')",environment: publishing,runs-on: "${{ needs.changes.outputs.linux_runner }}",timeout-minutes: 15,permissions: {contents: write,actions: read,id-token: write},steps: [{uses: actions/checkout@v6,with: {ref: main,persist-credentials: false}},{uses: actions/setup-node@v6,with: {node-version: "24",package-manager-cache: false}},{name: Disposabl installation token,run: node .github/scripts/disposabl.mjs token},{name: Select release source,id: source,run: bash .github/scripts/release.sh release-source},{uses: actions/download-artifact@v4,if: "steps.source.outputs.current == 'true'",with: {pattern: release-*,path: artifacts}},{name: Publish verified build artifacts,if: "steps.source.outputs.current == 'true'",run: bash .github/scripts/release.sh release-publish}]}}}
@@ -6,7 +6,9 @@
6
6
  "build": {
7
7
  "ios-preview": {
8
8
  "developmentClient": false,
9
- "ios": { "simulator": true },
9
+ "ios": {
10
+ "simulator": true
11
+ },
10
12
  "environment": "preview",
11
13
  "credentialsSource": "remote",
12
14
  "channel": "preview"
@@ -0,0 +1,9 @@
1
+ # Storefront observation
2
+
3
+ This local iOS Expo module invalidates cached website-checkout eligibility when StoreKit reports a storefront change. It registers a retained `SKPaymentTransactionObserver` synchronously before `start()` resolves. Its required transaction callback is intentionally empty; RevenueCat owns purchase processing.
4
+
5
+ Observation is reference-counted on the main dispatch queue. Each successful start needs a stop, and module destruction removes all remaining observation. Missing native support leaves website checkout unavailable.
6
+
7
+ StoreKit callback delivery to JavaScript is asynchronous. The billing hook also rechecks eligibility before browser handoff and cancels when an observed change invalidates that operation. These checks do not make the storefront read and browser opening atomic or monitor a checkout after the browser opens.
8
+
9
+ The queue observer API is deprecated, but provides a documented registration boundary. Do not replace it with an unawaited `Storefront.updates` task and assume observation is already active when the start call returns.
@@ -0,0 +1 @@
1
+ { "platforms": ["ios"], "ios": { "modules": ["StorefrontObserverModule"] } }
@@ -0,0 +1,15 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'StorefrontObserver'
3
+ s.version = '1.0.0'
4
+ s.summary = 'StoreKit storefront change signal'
5
+ s.description = 'Observes StoreKit storefront changes.'
6
+ s.license = { :type => 'MIT' }
7
+ s.author = 'Disposabl'
8
+ s.homepage = 'https://expo.dev'
9
+ s.platform = :ios, '16.4'
10
+ s.swift_version = '5.9'
11
+ s.source = { :git => 'https://github.com/expo/expo.git' }
12
+ s.static_framework = true
13
+ s.dependency 'ExpoModulesCore'
14
+ s.source_files = '**/*.{h,m,swift}'
15
+ end