@nimiplatform/app-tools 0.16.0-rc.14 → 0.16.0-rc.18

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 (84) hide show
  1. package/README.md +5 -42
  2. package/bin/nimi-app.mjs +25 -6
  3. package/lib/app-dependency-combinations.mjs +1 -0
  4. package/lib/app-doctor-update.mjs +8 -6
  5. package/lib/app-info.mjs +39 -19
  6. package/lib/app-lifecycle-guidance.mjs +1 -1
  7. package/lib/app-pack.mjs +31 -13
  8. package/lib/app-project-lifecycle.mjs +32 -12
  9. package/lib/app-resources.mjs +36 -0
  10. package/lib/app-scaffold-profiles.mjs +72 -2
  11. package/lib/app-scaffold.mjs +11 -13
  12. package/lib/index.mjs +7 -0
  13. package/lib/public-storefront.mjs +327 -0
  14. package/lib/storefront-media.mjs +8 -4
  15. package/lib/storefront-pack.mjs +152 -0
  16. package/lib/storefront-release-verification.mjs +31 -0
  17. package/lib/storefront-source.mjs +161 -0
  18. package/lib/web-coordination.mjs +4 -1
  19. package/lib/web-scaffold.mjs +3 -3
  20. package/package.json +9 -6
  21. package/scripts/sync-app-source.mjs +5 -12
  22. package/skills/nimi-app-lifecycle/SKILL.md +1 -0
  23. package/skills/nimi-app-lifecycle/references/storefront.md +28 -0
  24. package/templates/app-source/src/ai-studio-core/ai-config.ts +12 -0
  25. package/templates/app-source/src/ai-studio-core/ai-studio-core.css +138 -117
  26. package/templates/app-source/src/ai-studio-core/history.ts +10 -8
  27. package/templates/app-source/src/ai-studio-core/host-context.tsx +1 -0
  28. package/templates/app-source/src/ai-studio-core/job-recovery-panel.tsx +15 -10
  29. package/templates/app-source/src/ai-studio-core/job-recovery.ts +505 -115
  30. package/templates/app-source/src/ai-studio-core/messages/en.json +55 -9
  31. package/templates/app-source/src/ai-studio-core/messages/zh.json +55 -9
  32. package/templates/app-source/src/ai-studio-core/non-success-presentation.ts +8 -2
  33. package/templates/app-source/src/ai-studio-core/parameter-fields.tsx +2 -0
  34. package/templates/app-source/src/ai-studio-core/parameters.ts +5 -4
  35. package/templates/app-source/src/ai-studio-core/run-target.ts +12 -1
  36. package/templates/app-source/src/ai-studio-core/runtime-types.ts +3 -0
  37. package/templates/app-source/src/ai-studio-core/runtime.ts +50 -12
  38. package/templates/app-source/src/ai-studio-core/section-ai-testing-composer.tsx +6 -7
  39. package/templates/app-source/src/ai-studio-core/section-ai-testing-history.tsx +88 -27
  40. package/templates/app-source/src/ai-studio-core/section-ai-testing-input.ts +33 -0
  41. package/templates/app-source/src/ai-studio-core/section-ai-testing-music-result.tsx +2 -2
  42. package/templates/app-source/src/ai-studio-core/section-ai-testing-output.tsx +10 -3
  43. package/templates/app-source/src/ai-studio-core/section-ai-testing-result.tsx +6 -4
  44. package/templates/app-source/src/ai-studio-core/section-ai-testing-run.ts +121 -40
  45. package/templates/app-source/src/ai-studio-core/section-ai-testing-studio-result.tsx +34 -8
  46. package/templates/app-source/src/ai-studio-core/section-ai-testing-transcript-result.tsx +16 -2
  47. package/templates/app-source/src/ai-studio-core/section-ai-testing-transcription-result.tsx +18 -7
  48. package/templates/app-source/src/ai-studio-core/section-ai-testing-vision-result.tsx +1 -1
  49. package/templates/app-source/src/ai-studio-core/section-ai-testing.tsx +78 -9
  50. package/templates/app-source/src/ai-studio-core/text-media-replay.ts +2 -1
  51. package/templates/app-source/src/ai-studio-core/workspace.tsx +138 -3
  52. package/templates/app-source/src/product-modules/agent-center/index.tsx +19 -3
  53. package/templates/app-source/src/product-modules/agent-conversation/index.tsx +19 -3
  54. package/templates/app-source/src/product-modules/agent-realtime/index.tsx +19 -3
  55. package/templates/app-source/src/product-modules/kit-recipes/gallery.tsx +12 -7
  56. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-surface.tsx +48 -20
  57. package/templates/app-source/src/studio-modules/studio-create/messages/en.json +2 -2
  58. package/templates/app-source/src/studio-modules/studio-create/messages/zh.json +2 -2
  59. package/templates/app-source/src/studio-modules/studio-create/registration.ts +1 -1
  60. package/templates/app-source/src/studio-modules/studio-create/runtime.ts +11 -19
  61. package/templates/app-source/src/studio-modules/studio-media/audio-separate-parameters.tsx +7 -4
  62. package/templates/app-source/src/studio-modules/studio-media/audio-separate-runtime.ts +14 -10
  63. package/templates/app-source/src/studio-modules/studio-media/messages/en.json +3 -1
  64. package/templates/app-source/src/studio-modules/studio-media/messages/zh.json +3 -1
  65. package/templates/app-source/src/studio-modules/studio-media/music-parameters.tsx +6 -5
  66. package/templates/app-source/src/studio-modules/studio-media/music-transcription-parameters.tsx +19 -11
  67. package/templates/app-source/src/studio-modules/studio-media/music-transcription-runtime.ts +14 -10
  68. package/templates/app-source/src/studio-modules/studio-media/parameter-panel.tsx +54 -16
  69. package/templates/app-source/src/studio-modules/studio-media/runtime.ts +22 -9
  70. package/templates/app-source/src/studio-modules/studio-media/vision-runtime.ts +19 -10
  71. package/templates/app-source/src/studio-modules/studio-media/voice-convert-parameters.tsx +12 -6
  72. package/templates/app-source/src/studio-modules/studio-media/voice-convert-runtime.ts +11 -9
  73. package/templates/app-source/src/studio-modules/studio-voice/messages/en.json +5 -0
  74. package/templates/app-source/src/studio-modules/studio-voice/messages/zh.json +5 -0
  75. package/templates/app-source/src/studio-modules/studio-voice/parameter-panel.tsx +18 -7
  76. package/templates/app-source/src/studio-modules/studio-voice/parameters.ts +28 -4
  77. package/templates/app-source/src/studio-modules/studio-voice/runtime.ts +12 -8
  78. package/templates/app-source/src/workbench-core/runtime-gate.tsx +171 -44
  79. package/templates/app-source/src/workbench-core/workbench-core.css +226 -23
  80. package/templates/app-source/src/workbench-core/workbench-core.tsx +5 -5
  81. package/templates/app-source.manifest.json +2 -2
  82. package/templates/default-starter/NIMI_APP.md +11 -3
  83. package/templates/default-starter.manifest.json +2 -2
  84. package/templates/storefront-release.yml +97 -0
@@ -142,68 +142,244 @@
142
142
 
143
143
  .runtime-check-screen,
144
144
  .runtime-unavailable-screen {
145
- min-height: 100cqh;
145
+ box-sizing: border-box;
146
+ min-height: 100%;
147
+ height: 100%;
146
148
  position: relative;
147
149
  display: grid;
148
150
  place-items: center;
149
151
  padding: 24px;
152
+ overflow-y: auto;
153
+ background:
154
+ radial-gradient(circle at 18% 16%, var(--nimi-ambient-mesh-color-1), transparent 36%),
155
+ radial-gradient(circle at 86% 18%, var(--nimi-ambient-mesh-color-2), transparent 34%),
156
+ radial-gradient(circle at 28% 90%, var(--nimi-ambient-mesh-color-4), transparent 32%),
157
+ linear-gradient(120deg, var(--nimi-ambient-mesh-base-start) 0%, var(--nimi-app-background) 48%, var(--nimi-ambient-mesh-base-end) 100%);
158
+ color: var(--nimi-text-primary);
150
159
  }
151
160
 
152
- .runtime-alert-copy {
161
+ .runtime-check-panel {
162
+ box-sizing: border-box;
163
+ width: min(400px, 100%);
164
+ padding: 20px 22px;
165
+ border-radius: var(--nimi-radius-lg);
153
166
  display: grid;
154
- gap: 4px;
155
- min-width: 0;
167
+ gap: 10px;
156
168
  }
157
169
 
158
- .runtime-alert-copy strong,
159
- .runtime-alert-copy span {
160
- min-width: 0;
170
+ .runtime-check-hint {
171
+ margin: 0;
172
+ color: var(--nimi-text-secondary);
173
+ font-size: var(--nimi-type-body-sm-size);
174
+ line-height: 1.5;
161
175
  }
162
176
 
163
177
  .runtime-unavailable-panel {
164
- width: min(560px, 100%);
178
+ box-sizing: border-box;
179
+ width: min(468px, 100%);
180
+ padding: 24px;
181
+ border-radius: var(--nimi-radius-lg);
165
182
  display: grid;
166
183
  gap: 18px;
167
184
  }
168
185
 
169
- .runtime-unavailable-heading {
186
+ .runtime-gate-topbar {
187
+ display: flex;
188
+ align-items: center;
189
+ justify-content: space-between;
190
+ gap: 12px;
191
+ min-width: 0;
192
+ }
193
+
194
+ .runtime-gate-brand {
195
+ display: inline-flex;
196
+ align-items: center;
197
+ gap: 9px;
198
+ min-width: 0;
199
+ }
200
+
201
+ .runtime-gate-brand__mark {
202
+ width: 26px;
203
+ height: 26px;
204
+ border-radius: var(--nimi-radius-sm);
170
205
  display: grid;
171
- gap: 10px;
206
+ place-items: center;
207
+ flex-shrink: 0;
208
+ overflow: hidden;
209
+ background: var(--nimi-surface-canvas);
210
+ border: 1px solid var(--nimi-border-subtle);
211
+ color: var(--nimi-action-primary-bg);
212
+ font-size: var(--nimi-type-caption-size);
213
+ font-weight: 700;
214
+ }
215
+
216
+ .runtime-gate-brand__mark img {
217
+ width: 19px;
218
+ height: 19px;
219
+ object-fit: contain;
220
+ display: block;
221
+ }
222
+
223
+ .runtime-gate-brand__title {
224
+ font-size: var(--nimi-type-body-sm-size);
225
+ font-weight: 600;
226
+ color: var(--nimi-text-secondary);
227
+ overflow: hidden;
228
+ text-overflow: ellipsis;
229
+ white-space: nowrap;
230
+ }
231
+
232
+ .runtime-gate-hero {
233
+ display: grid;
234
+ justify-items: start;
235
+ gap: 8px;
236
+ min-width: 0;
237
+ }
238
+
239
+ .runtime-gate-icon {
240
+ width: 40px;
241
+ height: 40px;
242
+ margin-bottom: 2px;
243
+ border-radius: var(--nimi-radius-md);
244
+ display: grid;
245
+ place-items: center;
246
+ background: color-mix(in srgb, var(--nimi-action-primary-bg) 10%, var(--nimi-surface-canvas));
247
+ border: 1px solid color-mix(in srgb, var(--nimi-action-primary-bg) 20%, var(--nimi-border-subtle));
248
+ color: var(--nimi-action-primary-bg);
172
249
  }
173
250
 
174
- .runtime-unavailable-heading h1 {
251
+ .runtime-gate-icon[data-tone="warning"] {
252
+ background: var(--nimi-status-warning-soft-bg);
253
+ border-color: color-mix(in srgb, var(--nimi-status-warning-soft-text) 22%, var(--nimi-border-subtle));
254
+ color: var(--nimi-status-warning-soft-text);
255
+ }
256
+
257
+ .runtime-gate-hero h1 {
175
258
  margin: 0;
176
- letter-spacing: 0;
259
+ font-size: 1.25rem;
260
+ line-height: 1.35;
261
+ font-weight: 650;
262
+ letter-spacing: -0.015em;
263
+ color: var(--nimi-text-primary);
177
264
  }
178
265
 
179
- .runtime-action-hint {
266
+ .runtime-gate-summary {
180
267
  margin: 0;
181
268
  color: var(--nimi-text-secondary);
182
- font-size: 13px;
269
+ font-size: 0.84375rem;
270
+ line-height: 1.6;
271
+ }
272
+
273
+ .runtime-gate-guidance {
274
+ display: grid;
275
+ gap: 4px;
276
+ padding: 12px 14px;
277
+ border-radius: var(--nimi-radius-md);
278
+ background: color-mix(in srgb, var(--nimi-surface-canvas) 78%, transparent);
279
+ border: 1px solid var(--nimi-border-subtle);
280
+ }
281
+
282
+ .runtime-gate-guidance__label {
283
+ font-size: var(--nimi-type-overline-size);
284
+ line-height: 1.3;
285
+ font-weight: 650;
286
+ letter-spacing: 0.04em;
287
+ text-transform: uppercase;
288
+ color: var(--nimi-text-muted);
289
+ }
290
+
291
+ .runtime-action-hint {
292
+ margin: 0;
293
+ color: var(--nimi-text-primary);
294
+ font-size: var(--nimi-type-body-sm-size);
295
+ line-height: 1.55;
296
+ }
297
+
298
+ .runtime-gate-action-group {
299
+ display: grid;
300
+ gap: 8px;
183
301
  }
184
302
 
185
303
  .runtime-gate-actions {
186
304
  display: flex;
187
305
  flex-wrap: wrap;
306
+ align-items: center;
188
307
  gap: 10px;
189
308
  }
190
309
 
310
+ .runtime-gate-feedback {
311
+ margin: 0;
312
+ color: var(--nimi-text-muted);
313
+ font-size: var(--nimi-type-caption-size);
314
+ line-height: 1.5;
315
+ }
316
+
317
+ .runtime-gate-footer {
318
+ padding-top: 14px;
319
+ border-top: 1px solid var(--nimi-border-subtle);
320
+ min-width: 0;
321
+ }
322
+
191
323
  .runtime-gate-details {
192
324
  min-width: 0;
193
325
  color: var(--nimi-text-secondary);
194
- font-size: 12px;
326
+ font-size: var(--nimi-type-caption-size);
195
327
  }
196
328
 
197
329
  .runtime-gate-details summary {
330
+ list-style: none;
331
+ display: inline-flex;
332
+ align-items: center;
333
+ gap: 6px;
198
334
  width: fit-content;
335
+ padding: 2px 4px;
336
+ margin-left: -4px;
337
+ border-radius: var(--nimi-radius-sm);
338
+ color: var(--nimi-text-muted);
339
+ font-weight: 500;
199
340
  cursor: pointer;
341
+ user-select: none;
342
+ transition: color var(--nimi-motion-fast) var(--nimi-motion-ease-standard);
343
+ }
344
+
345
+ .runtime-gate-details summary::-webkit-details-marker {
346
+ display: none;
347
+ }
348
+
349
+ .runtime-gate-details summary:hover {
350
+ color: var(--nimi-text-primary);
351
+ }
352
+
353
+ .runtime-gate-details summary:focus-visible {
354
+ outline: var(--nimi-focus-ring-width) solid var(--nimi-focus-ring-color);
355
+ outline-offset: var(--nimi-focus-ring-offset);
356
+ }
357
+
358
+ .runtime-gate-details__chevron {
359
+ flex-shrink: 0;
360
+ transition: transform var(--nimi-motion-fast) var(--nimi-motion-ease-standard);
361
+ }
362
+
363
+ .runtime-gate-details[open] .runtime-gate-details__chevron {
364
+ transform: rotate(90deg);
365
+ }
366
+
367
+ .runtime-gate-details__body {
368
+ margin-top: 10px;
369
+ padding: 10px 12px;
370
+ border-radius: var(--nimi-radius-sm);
371
+ background: color-mix(in srgb, var(--nimi-surface-canvas) 80%, transparent);
372
+ border: 1px solid var(--nimi-border-subtle);
373
+ display: grid;
374
+ gap: 8px;
200
375
  }
201
376
 
202
377
  .runtime-gate-details dl {
203
378
  display: grid;
204
379
  grid-template-columns: max-content minmax(0, 1fr);
205
- gap: 6px 12px;
206
- margin: 10px 0 0;
380
+ gap: 6px 14px;
381
+ margin: 0;
382
+ align-items: baseline;
207
383
  }
208
384
 
209
385
  .runtime-gate-details dl > div {
@@ -211,17 +387,23 @@
211
387
  }
212
388
 
213
389
  .runtime-gate-details dt {
214
- font-weight: 600;
390
+ color: var(--nimi-text-muted);
391
+ font-size: var(--nimi-type-caption-size);
392
+ font-weight: 500;
215
393
  }
216
394
 
217
395
  .runtime-gate-details dd {
218
396
  margin: 0;
397
+ color: var(--nimi-text-primary);
398
+ font-size: var(--nimi-type-mono-size);
219
399
  overflow-wrap: anywhere;
220
400
  font-family: var(--nimi-font-mono);
221
401
  }
222
402
 
223
403
  .runtime-gate-details p {
224
- margin: 10px 0 0;
404
+ margin: 0;
405
+ color: var(--nimi-text-muted);
406
+ font-size: var(--nimi-type-caption-size);
225
407
  }
226
408
 
227
409
  .workbench-empty-state {
@@ -249,7 +431,7 @@
249
431
 
250
432
  .workbench-empty-state__eyebrow {
251
433
  color: var(--nimi-text-muted);
252
- font-size: 12px;
434
+ font-size: var(--nimi-type-caption-size);
253
435
  font-weight: var(--nimi-type-label-weight);
254
436
  letter-spacing: 0.08em;
255
437
  text-transform: uppercase;
@@ -265,21 +447,42 @@
265
447
 
266
448
  .workbench-empty-state__heading h1 {
267
449
  color: var(--nimi-text-primary);
268
- font-size: 28px;
450
+ font-size: 1.75rem;
269
451
  font-weight: var(--nimi-type-page-title-weight);
270
452
  }
271
453
 
272
454
  .workbench-empty-state__panel h2 {
273
455
  color: var(--nimi-text-primary);
274
- font-size: 20px;
456
+ font-size: 1.25rem;
275
457
  font-weight: var(--nimi-type-page-title-weight);
276
458
  }
277
459
 
278
460
  .workbench-empty-state__description {
279
461
  color: var(--nimi-text-secondary);
280
- font-size: 14px;
462
+ font-size: var(--nimi-type-body-size);
281
463
  line-height: 1.6;
282
464
  }
465
+
466
+ @media (prefers-reduced-transparency: reduce) {
467
+ .workbench,
468
+ .runtime-check-screen,
469
+ .runtime-unavailable-screen {
470
+ background: var(--nimi-surface-canvas);
471
+ }
472
+
473
+ .runtime-gate-guidance,
474
+ .runtime-gate-details__body {
475
+ background: var(--nimi-surface-panel);
476
+ }
477
+ }
478
+
479
+ @media (prefers-contrast: more) {
480
+ .runtime-gate-guidance,
481
+ .runtime-gate-details__body {
482
+ background: var(--nimi-surface-panel);
483
+ border-color: var(--nimi-border-strong);
484
+ }
485
+ }
283
486
  }
284
487
 
285
488
  @scope (.nimi-workbench-host) {
@@ -61,12 +61,12 @@ export function WorkbenchCore<TViewId extends string>({
61
61
  children,
62
62
  }: WorkbenchCoreProps<TViewId>) {
63
63
  return (
64
- <main className="workbench" data-testid={rootTestId} data-navigation-presentation={navigationPresentation} data-sidebar-visible={sidebarVisible}>
64
+ <div className="workbench" data-testid={rootTestId} data-navigation-presentation={navigationPresentation} data-sidebar-visible={sidebarVisible}>
65
65
  <div className="workbench__body">
66
66
  {sidebarVisible ? <aside className="workbench-side-nav" aria-label={navigationLabel}>
67
67
  {navigationPresentation === 'catalog' && navigationTitle ? (
68
68
  <div className="workbench-side-nav__heading">
69
- <h1>{navigationTitle}</h1>
69
+ <p className="workbench-side-nav__title">{navigationTitle}</p>
70
70
  {navigationDescription ? <p>{navigationDescription}</p> : null}
71
71
  {navigationToolbar}
72
72
  </div>
@@ -119,11 +119,11 @@ export function WorkbenchCore<TViewId extends string>({
119
119
  </div>
120
120
  ) : null}
121
121
  </aside> : null}
122
- <div className="workbench__main">
122
+ <main className="workbench__main">
123
123
  <div className="workbench__content">{children}</div>
124
- </div>
124
+ </main>
125
125
  </div>
126
- </main>
126
+ </div>
127
127
  );
128
128
  }
129
129
 
@@ -12,7 +12,7 @@
12
12
  "agent-realtime"
13
13
  ],
14
14
  "sourceIdentity": {
15
- "tauriIdentifier": "ai.nimi.apps.nimi.lab",
15
+ "nativeBundleIdentifier": "ai.nimi.apps.nimi.lab",
16
16
  "packageName": "@nimiplatform/lab",
17
17
  "cargoPackageName": "nimiapp-lab-shell",
18
18
  "appId": "nimi.lab",
@@ -23,7 +23,7 @@
23
23
  "devPort": "1468"
24
24
  },
25
25
  "identityReplacementOrder": [
26
- "tauriIdentifier",
26
+ "nativeBundleIdentifier",
27
27
  "packageName",
28
28
  "cargoPackageName",
29
29
  "accentPack",
@@ -1,7 +1,15 @@
1
1
  # Acme Widget
2
2
 
3
- Acme Widget is a new Nimi App under development. Its author has not yet supplied a finished product description or confirmed its user workflows.
3
+ *(Draft introduction — replace this copy with your App's real description before publishing.)*
4
4
 
5
- Open it from Nimi Home when its author makes it available. Keep Nimi running while using the App. Follow the App's available controls and configure the resources required by the task before using AI features.
5
+ Acme Widget helps you [describe the main task in one clear sentence].
6
6
 
7
- Feature availability, data handling, limitations and support information still need to be supplied by the author. This starter introduction does not establish a completed or released product.
7
+ ## Get Started
8
+
9
+ 1. Open Acme Widget from Nimi Home while Nimi is running.
10
+ 2. Choose a local or cloud AI model in Settings when a task needs AI.
11
+
12
+ ## Data, Limits & Help
13
+
14
+ - Explain what stays on the user's computer and when requests go to a chosen cloud provider (cloud calls may incur provider charges).
15
+ - Note any important current limitations and where users can get support.
@@ -2,7 +2,7 @@
2
2
  "manifestVersion": 1,
3
3
  "sourceApp": "app-tools/default-starter",
4
4
  "sourceIdentity": {
5
- "tauriIdentifier": "ai.nimi.apps.acme.widget",
5
+ "nativeBundleIdentifier": "ai.nimi.apps.acme.widget",
6
6
  "packageName": "acme-widget",
7
7
  "cargoPackageName": "acme-widget-shell",
8
8
  "appId": "acme.widget",
@@ -13,7 +13,7 @@
13
13
  "devPort": "1466"
14
14
  },
15
15
  "identityReplacementOrder": [
16
- "tauriIdentifier",
16
+ "nativeBundleIdentifier",
17
17
  "cargoPackageName",
18
18
  "packageName",
19
19
  "rendererEntryId",
@@ -0,0 +1,97 @@
1
+ name: Release immutable Nimi storefront
2
+ on:
3
+ push:
4
+ tags: ['storefront-v*']
5
+ permissions: {}
6
+ concurrency:
7
+ group: storefront-${{ github.ref }}
8
+ cancel-in-progress: false
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+ outputs:
15
+ artifact_id: ${{ steps.upload.outputs.artifact-id }}
16
+ steps:
17
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
18
+ with:
19
+ fetch-depth: 0
20
+ persist-credentials: false
21
+ - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
22
+ with:
23
+ node-version: '24.22.3'
24
+ package-manager-cache: false
25
+ - name: Build the storefront at the tagged commit
26
+ env:
27
+ DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
28
+ ELECTRON_SKIP_BINARY_DOWNLOAD: '1'
29
+ run: |
30
+ set -euo pipefail
31
+ git merge-base --is-ancestor HEAD "refs/remotes/origin/$DEFAULT_BRANCH"
32
+ [[ "$GITHUB_REF_NAME" =~ ^storefront-v([1-9][0-9]*)$ ]]
33
+ revision="${BASH_REMATCH[1]}"
34
+ corepack enable
35
+ pnpm install --frozen-lockfile
36
+ pnpm exec nimi-app check --storefront --production
37
+ pnpm exec nimi-app pack --storefront --rev "$revision" --production --json > "$RUNNER_TEMP/storefront.json"
38
+ mkdir -p "$RUNNER_TEMP/release"
39
+ node --input-type=module - <<'NODE'
40
+ import { readFileSync, copyFileSync } from 'node:fs';
41
+ import { join, basename } from 'node:path';
42
+ const result = JSON.parse(readFileSync(join(process.env.RUNNER_TEMP, 'storefront.json'), 'utf8'));
43
+ for (const asset of [result.manifest, result.media_archive]) copyFileSync(asset.path, join(process.env.RUNNER_TEMP, 'release', basename(asset.path)));
44
+ NODE
45
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
46
+ id: upload
47
+ with:
48
+ name: storefront
49
+ path: ${{ runner.temp }}/release/
50
+ if-no-files-found: error
51
+ publish:
52
+ needs: build
53
+ runs-on: ubuntu-latest
54
+ permissions:
55
+ contents: write
56
+ id-token: write
57
+ attestations: write
58
+ artifact-metadata: write
59
+ steps:
60
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
61
+ with:
62
+ artifact-ids: ${{ needs.build.outputs.artifact_id }}
63
+ path: release
64
+ - uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6
65
+ with:
66
+ subject-path: 'release/*'
67
+ - name: Publish and verify both immutable assets
68
+ env:
69
+ GH_TOKEN: ${{ github.token }}
70
+ run: |
71
+ set -euo pipefail
72
+ shopt -s nullglob
73
+ manifests=(release/*-storefront-*.json)
74
+ archives=(release/*-storefront-*-media.zip)
75
+ test "${#manifests[@]}" = 1 && test "${#archives[@]}" = 1
76
+ files=("${manifests[0]}" "${archives[0]}")
77
+ if ! gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
78
+ gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --verify-tag --draft --latest=false --title "$GITHUB_REF_NAME" --notes "Reviewed storefront input for $GITHUB_REF_NAME"
79
+ fi
80
+ if [[ "$(gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --json isDraft --jq .isDraft)" == true ]]; then
81
+ for asset in "${files[@]}"; do
82
+ if gh release download "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --pattern "$(basename "$asset")" --dir "$RUNNER_TEMP"; then
83
+ cmp "$asset" "$RUNNER_TEMP/$(basename "$asset")"
84
+ else
85
+ gh release upload "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" "$asset"
86
+ fi
87
+ done
88
+ gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --draft=false --latest=false
89
+ fi
90
+ for asset in "${files[@]}"; do
91
+ for attempt in 1 2 3 4 5 6; do
92
+ if message=$(gh release verify-asset "$GITHUB_REF_NAME" "$asset" --repo "$GITHUB_REPOSITORY" 2>&1); then break; fi
93
+ echo "$message" >&2
94
+ if [[ "$message" != *"no attestations found for tag $GITHUB_REF_NAME ("* || "$attempt" == 6 ]]; then exit 1; fi
95
+ sleep 10
96
+ done
97
+ done