code-foundry 1.37.3 → 1.38.0
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.
- package/.github/workflows/cloudflare-delivery.yml +92 -118
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
|
@@ -120,31 +120,105 @@ concurrency:
|
|
|
120
120
|
cancel-in-progress: false
|
|
121
121
|
|
|
122
122
|
jobs:
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
candidate:
|
|
124
|
+
# The Turbo impact check lives here as steps instead of a separate job:
|
|
125
|
+
# one checkout and one dependency install serve both the query and the
|
|
126
|
+
# candidate build (mirrors the cloudflare-deploy.yml fold). Every
|
|
127
|
+
# delivery step is skipped when the package is unaffected, and the check
|
|
128
|
+
# defaults to deploying whenever it cannot run.
|
|
125
129
|
if: >-
|
|
126
|
-
inputs['turbo-filter'] != '' &&
|
|
127
|
-
(github.event_name == 'pull_request' || github.event_name == 'push') &&
|
|
128
130
|
vars.CI_BILLING_PAUSED != 'true' &&
|
|
129
131
|
(inputs['draft-protection'] != true || github.event_name != 'pull_request' || github.event.pull_request.draft == false) &&
|
|
130
132
|
(github.event_name != 'pull_request' || inputs.mode != 'preview' || !startsWith(github.event.pull_request.head.ref, 'release-please--branches--main')) &&
|
|
131
133
|
github.event_name != 'pull_request_target' &&
|
|
132
134
|
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
|
|
133
135
|
runs-on: ubuntu-latest
|
|
134
|
-
timeout-minutes:
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
timeout-minutes: 40
|
|
137
|
+
# The explicit deployment record below is the sole GitHub deployment record.
|
|
138
|
+
# Keep the environment for approvals, secrets, and branch protection without
|
|
139
|
+
# creating a second, competing PR timeline entry.
|
|
140
|
+
environment:
|
|
141
|
+
name: Preview
|
|
142
|
+
deployment: false
|
|
143
|
+
url: ${{ steps.upload.outputs.url }}
|
|
144
|
+
defaults:
|
|
145
|
+
run:
|
|
146
|
+
working-directory: ${{ inputs.working-directory }}
|
|
147
|
+
env:
|
|
148
|
+
FOUNDRY_MODE: ${{ inputs.mode }}
|
|
149
|
+
FOUNDRY_WORKER: ${{ inputs.worker-name }}
|
|
150
|
+
FOUNDRY_PHASE: candidate
|
|
151
|
+
FOUNDRY_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
|
152
|
+
ARTIFACT_PATH: ${{ inputs.artifact-path }}
|
|
153
|
+
VERIFY_COMMAND: ${{ inputs.verify-command }}
|
|
154
|
+
SMOKE_PATH: ${{ inputs.smoke-path }}
|
|
155
|
+
WRANGLER_VERSION: ${{ inputs.wrangler-version }}
|
|
156
|
+
WRANGLER_ENVIRONMENT: ${{ inputs.wrangler-environment }}
|
|
157
|
+
WRANGLER_CONFIG: ${{ inputs.wrangler-config }}
|
|
158
|
+
BINDING_POLICY_FILE: ${{ inputs.binding-policy-file }}
|
|
159
|
+
DEPLOYMENT_ENVIRONMENT: Preview
|
|
137
160
|
outputs:
|
|
138
|
-
|
|
161
|
+
url: ${{ steps.upload.outputs.url }}
|
|
162
|
+
version-id: ${{ steps.upload.outputs.version-id }}
|
|
163
|
+
artifact-digest: ${{ steps.upload.outputs.artifact-digest }}
|
|
164
|
+
source-sha: ${{ steps.upload.outputs.source-sha }}
|
|
165
|
+
verified: ${{ steps.verify.outputs.verified }}
|
|
166
|
+
github-deployment-id: ${{ steps.start.outputs.github-deployment-id }}
|
|
139
167
|
steps:
|
|
140
|
-
- name: Checkout
|
|
168
|
+
- name: Checkout source
|
|
141
169
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
142
170
|
with:
|
|
143
|
-
|
|
171
|
+
persist-credentials: false
|
|
172
|
+
# The Turbo affected query compares the head tree against the base
|
|
173
|
+
# commit, so the checkout needs history; blob:none keeps it light.
|
|
144
174
|
fetch-depth: 0
|
|
175
|
+
filter: blob:none
|
|
176
|
+
- name: Validate inputs
|
|
177
|
+
env:
|
|
178
|
+
RUNTIME_REF: ${{ inputs.runtime-ref }}
|
|
179
|
+
CANARY_PERCENTAGE: ${{ inputs.canary-percentage }}
|
|
180
|
+
CANARY_VERIFY_COMMAND: ${{ inputs.canary-verify-command }}
|
|
181
|
+
PRODUCTION_URL: ${{ inputs.production-url }}
|
|
182
|
+
run: |
|
|
183
|
+
set -euo pipefail
|
|
184
|
+
[[ "$RUNTIME_REF" =~ ^[0-9a-fA-F]{40}$ ]]
|
|
185
|
+
[[ "$FOUNDRY_MODE" == preview || "$FOUNDRY_MODE" == production ]]
|
|
186
|
+
node --input-type=module <<'NODE'
|
|
187
|
+
const percentage = Number(process.env.CANARY_PERCENTAGE)
|
|
188
|
+
if (!Number.isFinite(percentage) || percentage < 0.01 || percentage > 100 || (percentage < 100 && percentage > 99.99)) process.exit(1)
|
|
189
|
+
if (process.env.FOUNDRY_MODE === 'production' && percentage < 100) {
|
|
190
|
+
let argv
|
|
191
|
+
try { argv = JSON.parse(process.env.CANARY_VERIFY_COMMAND ?? '') } catch { process.exit(1) }
|
|
192
|
+
if (!Array.isArray(argv) || !argv.length || argv.some((arg) => typeof arg !== 'string' || !arg.length || arg.includes('\0'))) process.exit(1)
|
|
193
|
+
}
|
|
194
|
+
NODE
|
|
195
|
+
if [[ "$FOUNDRY_MODE" == production ]]; then
|
|
196
|
+
[[ "$GITHUB_REF" == "refs/heads/$FOUNDRY_DEFAULT_BRANCH" ]]
|
|
197
|
+
[[ "$PRODUCTION_URL" == https://* ]]
|
|
198
|
+
fi
|
|
199
|
+
- name: Checkout delivery runtime
|
|
200
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
201
|
+
with:
|
|
202
|
+
repository: 0xPlayerOne/code-foundry
|
|
203
|
+
ref: ${{ inputs.runtime-ref }}
|
|
204
|
+
path: .github/.code-foundry-delivery
|
|
145
205
|
persist-credentials: false
|
|
206
|
+
sparse-checkout: src
|
|
207
|
+
- name: Prepare delivery state
|
|
208
|
+
run: |
|
|
209
|
+
echo "FOUNDRY_EXECUTOR=$GITHUB_WORKSPACE/.github/.code-foundry-delivery/src/commands/cloudflare-delivery.mjs" >> "$GITHUB_ENV"
|
|
210
|
+
echo "FOUNDRY_STATE_FILE=$RUNNER_TEMP/cloudflare-candidate.json" >> "$GITHUB_ENV"
|
|
211
|
+
- name: Set up Bun
|
|
212
|
+
if: inputs.build-script != '' || inputs['turbo-filter'] != ''
|
|
213
|
+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
|
214
|
+
with:
|
|
215
|
+
bun-version: ${{ inputs.bun-version }}
|
|
216
|
+
- name: Install locked dependencies
|
|
217
|
+
working-directory: ${{ inputs.install-working-directory }}
|
|
218
|
+
run: bun install --frozen-lockfile
|
|
146
219
|
- name: Resolve Turbo package
|
|
147
220
|
id: resolve
|
|
221
|
+
if: inputs['turbo-filter'] != ''
|
|
148
222
|
working-directory: ${{ inputs.install-working-directory }}
|
|
149
223
|
env:
|
|
150
224
|
TURBO_FILTER: ${{ inputs.turbo-filter }}
|
|
@@ -193,17 +267,7 @@ jobs:
|
|
|
193
267
|
}
|
|
194
268
|
}
|
|
195
269
|
NODE
|
|
196
|
-
- name: Set up Bun
|
|
197
|
-
if: steps.resolve.outputs.turbo_enabled == 'true'
|
|
198
|
-
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
|
199
|
-
with:
|
|
200
|
-
bun-version: ${{ inputs.bun-version }}
|
|
201
|
-
- name: Install dependencies for Turbo
|
|
202
|
-
if: steps.resolve.outputs.turbo_enabled == 'true'
|
|
203
|
-
working-directory: ${{ inputs.install-working-directory }}
|
|
204
|
-
run: bun install --frozen-lockfile --ignore-scripts
|
|
205
270
|
- name: Check affected build task
|
|
206
|
-
if: steps.resolve.outputs.turbo_enabled == 'true'
|
|
207
271
|
id: check
|
|
208
272
|
working-directory: ${{ inputs.install-working-directory }}
|
|
209
273
|
env:
|
|
@@ -234,138 +298,48 @@ jobs:
|
|
|
234
298
|
console.log(`${packageName}: ${affected ? 'affected' : 'unaffected'}`)
|
|
235
299
|
appendFileSync(process.env.GITHUB_OUTPUT, `should_deploy=${affected}\n`)
|
|
236
300
|
NODE
|
|
237
|
-
|
|
238
|
-
candidate:
|
|
239
|
-
needs: affected
|
|
240
|
-
if: >-
|
|
241
|
-
always() &&
|
|
242
|
-
vars.CI_BILLING_PAUSED != 'true' &&
|
|
243
|
-
(inputs['draft-protection'] != true || github.event_name != 'pull_request' || github.event.pull_request.draft == false) &&
|
|
244
|
-
(github.event_name != 'pull_request' || inputs.mode != 'preview' || !startsWith(github.event.pull_request.head.ref, 'release-please--branches--main')) &&
|
|
245
|
-
github.event_name != 'pull_request_target' &&
|
|
246
|
-
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
|
|
247
|
-
(
|
|
248
|
-
inputs['turbo-filter'] == '' ||
|
|
249
|
-
needs.affected.result == 'skipped' ||
|
|
250
|
-
needs.affected.outputs.should_deploy == 'true'
|
|
251
|
-
)
|
|
252
|
-
runs-on: ubuntu-latest
|
|
253
|
-
timeout-minutes: 30
|
|
254
|
-
# The explicit deployment record below is the sole GitHub deployment record.
|
|
255
|
-
# Keep the environment for approvals, secrets, and branch protection without
|
|
256
|
-
# creating a second, competing PR timeline entry.
|
|
257
|
-
environment:
|
|
258
|
-
name: Preview
|
|
259
|
-
deployment: false
|
|
260
|
-
url: ${{ steps.upload.outputs.url }}
|
|
261
|
-
defaults:
|
|
262
|
-
run:
|
|
263
|
-
working-directory: ${{ inputs.working-directory }}
|
|
264
|
-
env:
|
|
265
|
-
FOUNDRY_MODE: ${{ inputs.mode }}
|
|
266
|
-
FOUNDRY_WORKER: ${{ inputs.worker-name }}
|
|
267
|
-
FOUNDRY_PHASE: candidate
|
|
268
|
-
FOUNDRY_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
|
269
|
-
ARTIFACT_PATH: ${{ inputs.artifact-path }}
|
|
270
|
-
VERIFY_COMMAND: ${{ inputs.verify-command }}
|
|
271
|
-
SMOKE_PATH: ${{ inputs.smoke-path }}
|
|
272
|
-
WRANGLER_VERSION: ${{ inputs.wrangler-version }}
|
|
273
|
-
WRANGLER_ENVIRONMENT: ${{ inputs.wrangler-environment }}
|
|
274
|
-
WRANGLER_CONFIG: ${{ inputs.wrangler-config }}
|
|
275
|
-
BINDING_POLICY_FILE: ${{ inputs.binding-policy-file }}
|
|
276
|
-
DEPLOYMENT_ENVIRONMENT: Preview
|
|
277
|
-
outputs:
|
|
278
|
-
url: ${{ steps.upload.outputs.url }}
|
|
279
|
-
version-id: ${{ steps.upload.outputs.version-id }}
|
|
280
|
-
artifact-digest: ${{ steps.upload.outputs.artifact-digest }}
|
|
281
|
-
source-sha: ${{ steps.upload.outputs.source-sha }}
|
|
282
|
-
verified: ${{ steps.verify.outputs.verified }}
|
|
283
|
-
github-deployment-id: ${{ steps.start.outputs.github-deployment-id }}
|
|
284
|
-
steps:
|
|
285
|
-
- name: Checkout source
|
|
286
|
-
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
287
|
-
with:
|
|
288
|
-
persist-credentials: false
|
|
289
|
-
- name: Validate inputs
|
|
290
|
-
env:
|
|
291
|
-
RUNTIME_REF: ${{ inputs.runtime-ref }}
|
|
292
|
-
CANARY_PERCENTAGE: ${{ inputs.canary-percentage }}
|
|
293
|
-
CANARY_VERIFY_COMMAND: ${{ inputs.canary-verify-command }}
|
|
294
|
-
PRODUCTION_URL: ${{ inputs.production-url }}
|
|
295
|
-
run: |
|
|
296
|
-
set -euo pipefail
|
|
297
|
-
[[ "$RUNTIME_REF" =~ ^[0-9a-fA-F]{40}$ ]]
|
|
298
|
-
[[ "$FOUNDRY_MODE" == preview || "$FOUNDRY_MODE" == production ]]
|
|
299
|
-
node --input-type=module <<'NODE'
|
|
300
|
-
const percentage = Number(process.env.CANARY_PERCENTAGE)
|
|
301
|
-
if (!Number.isFinite(percentage) || percentage < 0.01 || percentage > 100 || (percentage < 100 && percentage > 99.99)) process.exit(1)
|
|
302
|
-
if (process.env.FOUNDRY_MODE === 'production' && percentage < 100) {
|
|
303
|
-
let argv
|
|
304
|
-
try { argv = JSON.parse(process.env.CANARY_VERIFY_COMMAND ?? '') } catch { process.exit(1) }
|
|
305
|
-
if (!Array.isArray(argv) || !argv.length || argv.some((arg) => typeof arg !== 'string' || !arg.length || arg.includes('\0'))) process.exit(1)
|
|
306
|
-
}
|
|
307
|
-
NODE
|
|
308
|
-
if [[ "$FOUNDRY_MODE" == production ]]; then
|
|
309
|
-
[[ "$GITHUB_REF" == "refs/heads/$FOUNDRY_DEFAULT_BRANCH" ]]
|
|
310
|
-
[[ "$PRODUCTION_URL" == https://* ]]
|
|
311
|
-
fi
|
|
312
|
-
- name: Checkout delivery runtime
|
|
313
|
-
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
314
|
-
with:
|
|
315
|
-
repository: 0xPlayerOne/code-foundry
|
|
316
|
-
ref: ${{ inputs.runtime-ref }}
|
|
317
|
-
path: .github/.code-foundry-delivery
|
|
318
|
-
persist-credentials: false
|
|
319
|
-
sparse-checkout: src
|
|
320
|
-
- name: Prepare delivery state
|
|
321
|
-
run: |
|
|
322
|
-
echo "FOUNDRY_EXECUTOR=$GITHUB_WORKSPACE/.github/.code-foundry-delivery/src/commands/cloudflare-delivery.mjs" >> "$GITHUB_ENV"
|
|
323
|
-
echo "FOUNDRY_STATE_FILE=$RUNNER_TEMP/cloudflare-candidate.json" >> "$GITHUB_ENV"
|
|
324
301
|
- name: Record pending application deployment
|
|
302
|
+
if: steps.check.outputs.should_deploy != 'false'
|
|
325
303
|
id: start
|
|
326
304
|
env:
|
|
327
305
|
GH_TOKEN: ${{ github.token }}
|
|
328
306
|
GITHUB_DEPLOYMENT_REF: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
329
307
|
run: node "$FOUNDRY_EXECUTOR" record-start
|
|
330
|
-
- name: Set up Bun
|
|
331
|
-
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
|
332
|
-
with:
|
|
333
|
-
bun-version: ${{ inputs.bun-version }}
|
|
334
|
-
- name: Install locked dependencies
|
|
335
|
-
working-directory: ${{ inputs.install-working-directory }}
|
|
336
|
-
run: bun install --frozen-lockfile
|
|
337
308
|
- name: Build candidate
|
|
338
|
-
if: inputs.build-script != ''
|
|
309
|
+
if: inputs.build-script != '' && steps.check.outputs.should_deploy != 'false'
|
|
339
310
|
env:
|
|
340
311
|
BUILD_SCRIPT: ${{ inputs.build-script }}
|
|
341
312
|
run: bun run "$BUILD_SCRIPT"
|
|
342
313
|
- name: Reject stale production source
|
|
343
|
-
if: inputs.mode == 'production'
|
|
314
|
+
if: inputs.mode == 'production' && steps.check.outputs.should_deploy != 'false'
|
|
344
315
|
env:
|
|
345
316
|
GH_TOKEN: ${{ github.token }}
|
|
346
317
|
run: node "$FOUNDRY_EXECUTOR" assert-current
|
|
347
318
|
- name: Upload candidate without changing traffic
|
|
319
|
+
if: steps.check.outputs.should_deploy != 'false'
|
|
348
320
|
id: upload
|
|
349
321
|
env:
|
|
350
322
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
351
323
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
352
324
|
run: node "$FOUNDRY_EXECUTOR" upload
|
|
353
325
|
- name: Inspect actual candidate bindings
|
|
326
|
+
if: steps.check.outputs.should_deploy != 'false'
|
|
354
327
|
env:
|
|
355
328
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
356
329
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
357
330
|
run: node "$FOUNDRY_EXECUTOR" inspect
|
|
358
331
|
- name: Verify candidate
|
|
332
|
+
if: steps.check.outputs.should_deploy != 'false'
|
|
359
333
|
id: verify
|
|
360
334
|
run: node "$FOUNDRY_EXECUTOR" verify
|
|
361
335
|
- name: Complete application deployment status
|
|
362
|
-
if: always() && steps.start.outputs.github-deployment-id != ''
|
|
336
|
+
if: always() && steps.check.outputs.should_deploy != 'false' && steps.start.outputs.github-deployment-id != ''
|
|
363
337
|
env:
|
|
364
338
|
GH_TOKEN: ${{ github.token }}
|
|
365
339
|
DEPLOYMENT_STATUS: ${{ job.status }}
|
|
366
340
|
run: node "$FOUNDRY_EXECUTOR" record-finish
|
|
367
341
|
- name: Preserve candidate evidence
|
|
368
|
-
if: always() && steps.start.outputs.github-deployment-id != ''
|
|
342
|
+
if: always() && steps.check.outputs.should_deploy != 'false' && steps.start.outputs.github-deployment-id != ''
|
|
369
343
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
|
370
344
|
with:
|
|
371
345
|
name: cloudflare-candidate-${{ inputs.worker-name }}-${{ github.run_id }}-${{ github.run_attempt }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.38.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.37.3...v1.38.0) (2026-09-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* fold the Turbo impact check into the delivery candidate job ([#676](https://github.com/0xPlayerOne/code-foundry/issues/676)) ([fd99d29](https://github.com/0xPlayerOne/code-foundry/commit/fd99d29ae7e10ef9346b8059dcad0ed4df6df109))
|
|
9
|
+
|
|
3
10
|
## [1.37.3](https://github.com/0xPlayerOne/code-foundry/compare/v1.37.2...v1.37.3) (2026-09-30)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-foundry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
|
|
5
5
|
"homepage": "https://github.com/0xPlayerOne/code-foundry#readme",
|
|
6
6
|
"bugs": {
|