code-foundry 1.35.0 → 1.36.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.
- package/.github/workflows/cloudflare-deploy.yml +49 -0
- package/CHANGELOG.md +14 -0
- package/docs/CONFIGURATION.md +7 -1
- package/package.json +1 -1
|
@@ -8,6 +8,11 @@ on:
|
|
|
8
8
|
required: false
|
|
9
9
|
type: string
|
|
10
10
|
default: preview
|
|
11
|
+
deploy-tool:
|
|
12
|
+
description: 'Deployment CLI: wrangler (default, reads a wrangler config) or cf (Cloudflare cf CLI; deploys the cf Build Output produced by cf-wrangler build).'
|
|
13
|
+
required: false
|
|
14
|
+
type: string
|
|
15
|
+
default: wrangler
|
|
11
16
|
draft-protection:
|
|
12
17
|
description: 'Skip draft pull requests by default; set false to run deployments for drafts.'
|
|
13
18
|
required: false
|
|
@@ -116,9 +121,17 @@ jobs:
|
|
|
116
121
|
env:
|
|
117
122
|
MODE: ${{ inputs.mode }}
|
|
118
123
|
WRANGLER_VERSION: ${{ inputs.wrangler-version }}
|
|
124
|
+
DEPLOY_TOOL: ${{ inputs.deploy-tool }}
|
|
125
|
+
BUILD_SCRIPT: ${{ inputs.build-script }}
|
|
119
126
|
run: |
|
|
120
127
|
set -euo pipefail
|
|
121
128
|
[[ "$MODE" == preview || "$MODE" == production ]]
|
|
129
|
+
[[ "$DEPLOY_TOOL" == wrangler || "$DEPLOY_TOOL" == cf ]]
|
|
130
|
+
[[ "$WRANGLER_VERSION" == local || "$WRANGLER_VERSION" == latest || "$WRANGLER_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]
|
|
131
|
+
# The cf path runs the project's cf-wrangler delegate to refresh the
|
|
132
|
+
# Build Output; that delegate comes from the app's own dependencies,
|
|
133
|
+
# which only the build step installs.
|
|
134
|
+
[[ "$DEPLOY_TOOL" != cf || -n "$BUILD_SCRIPT" ]]
|
|
122
135
|
[[ "$WRANGLER_VERSION" == local || "$WRANGLER_VERSION" == latest || "$WRANGLER_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]
|
|
123
136
|
- name: Set up Bun
|
|
124
137
|
if: inputs.build-script != '' || inputs['turbo-filter'] != ''
|
|
@@ -262,8 +275,44 @@ jobs:
|
|
|
262
275
|
WRANGLER_VERSION: ${{ inputs.wrangler-version }}
|
|
263
276
|
MODE: ${{ inputs.mode }}
|
|
264
277
|
DEPLOYMENT_URL: ${{ inputs.deployment-url }}
|
|
278
|
+
DEPLOY_TOOL: ${{ inputs.deploy-tool }}
|
|
279
|
+
PREVIEW_NAME: ${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}
|
|
265
280
|
run: |
|
|
266
281
|
set -euo pipefail
|
|
282
|
+
if [ "$DEPLOY_TOOL" = cf ]; then
|
|
283
|
+
# cf path: refresh the Build Output with the project's own
|
|
284
|
+
# cf-wrangler delegate, then deploy/preview it with the cf CLI.
|
|
285
|
+
# Both CLIs come from the app's devDependencies installed by the
|
|
286
|
+
# build step; the Node launcher avoids the Bun-runtime trap.
|
|
287
|
+
cfbin=(npx --no-install)
|
|
288
|
+
"${cfbin[@]}" cf-wrangler build
|
|
289
|
+
if [ "$MODE" = production ]; then
|
|
290
|
+
out="$("${cfbin[@]}" cf deploy --prebuilt)"
|
|
291
|
+
printf '%s\n' "$out"
|
|
292
|
+
version_id="$(printf '%s\n' "$out" | sed -n 's/.*Current Version ID: *//p' | head -1 | tr -d '[:space:]')"
|
|
293
|
+
value="${DEPLOYMENT_URL:-$(printf '%s\n' "$out" | grep -o 'https://[^[:space:]]*' | head -1)}"
|
|
294
|
+
else
|
|
295
|
+
# Previews refuse a production Build Output; rebuild flagged as
|
|
296
|
+
# a preview build first.
|
|
297
|
+
CLOUDFLARE_PREVIEW_BUILD=true "${cfbin[@]}" cf-wrangler build --mode preview
|
|
298
|
+
"${cfbin[@]}" cf previews deploy "$PREVIEW_NAME" > "$RUNNER_TEMP/cf-preview.json"
|
|
299
|
+
value="$(jq -r '.preview_urls[0] // empty' "$RUNNER_TEMP/cf-preview.json")"
|
|
300
|
+
version_id="$(jq -r '.deployment_id // empty' "$RUNNER_TEMP/cf-preview.json")"
|
|
301
|
+
fi
|
|
302
|
+
if [[ ! "$version_id" =~ ^[0-9a-f-]{36}$ ]]; then
|
|
303
|
+
echo 'cf deploy did not report a Worker version ID' >&2
|
|
304
|
+
exit 1
|
|
305
|
+
fi
|
|
306
|
+
if [[ -z "$value" || "$value" != https://* || "$value" == *'@'* || "$value" == *'#'* || "$value" == *' '* ]]; then
|
|
307
|
+
echo 'cf deploy did not report a valid deployment URL' >&2
|
|
308
|
+
exit 1
|
|
309
|
+
fi
|
|
310
|
+
{
|
|
311
|
+
echo "url=$value"
|
|
312
|
+
echo "version-id=$version_id"
|
|
313
|
+
} >> "$GITHUB_OUTPUT"
|
|
314
|
+
exit 0
|
|
315
|
+
fi
|
|
267
316
|
if [ "$WRANGLER_VERSION" = local ]; then
|
|
268
317
|
if [ -n "$BUILD_SCRIPT" ]; then
|
|
269
318
|
wrangler=(npx --no-install wrangler)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.36.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.36.0...v1.36.1) (2026-09-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **cloudflare:** build a preview Build Output before cf previews deploy ([#660](https://github.com/0xPlayerOne/code-foundry/issues/660)) ([d897380](https://github.com/0xPlayerOne/code-foundry/commit/d897380110a692143b3bcb0915d8ce40cff4663c))
|
|
9
|
+
|
|
10
|
+
## [1.36.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.35.0...v1.36.0) (2026-09-29)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **cloudflare:** add a cf deploy mode to cloudflare-deploy.yml ([#658](https://github.com/0xPlayerOne/code-foundry/issues/658)) ([31ef8ca](https://github.com/0xPlayerOne/code-foundry/commit/31ef8ca607c189d7ca0bbe4f42de85ee27edabc9))
|
|
16
|
+
|
|
3
17
|
## [1.35.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.34.0...v1.35.0) (2026-09-29)
|
|
4
18
|
|
|
5
19
|
|
package/docs/CONFIGURATION.md
CHANGED
|
@@ -301,7 +301,13 @@ repository and configure environment reviewers separately.
|
|
|
301
301
|
The legacy `cloudflare-deploy.yml` workflow remains available for direct
|
|
302
302
|
(unverified) deployments. It runs `wrangler versions upload` for previews and
|
|
303
303
|
`wrangler deploy` for production, records a GitHub deployment plus status, and
|
|
304
|
-
respects `CI_BILLING_PAUSED`.
|
|
304
|
+
respects `CI_BILLING_PAUSED`. With `deploy-tool: cf` it instead deploys through
|
|
305
|
+
the Cloudflare cf CLI: production runs `cf-wrangler build` plus
|
|
306
|
+
`cf deploy --prebuilt` (consuming the project's cf Build Output), previews run
|
|
307
|
+
`cf previews deploy` named after the pull request or branch, and the cf/wrangler
|
|
308
|
+
CLIs must be devDependencies of the deployed package (the build step installs
|
|
309
|
+
them), so `build-script` is required. Deployment URLs and version IDs are
|
|
310
|
+
extracted from the same job outputs either way. Preview deployment records use the pull request
|
|
305
311
|
head SHA when called from a PR, which lets GitHub show the completed preview in
|
|
306
312
|
the PR's Deployments section; direct pushes use the workflow SHA. Its
|
|
307
313
|
legacy-compatible Wrangler default is `latest`; callers should prefer `local` or
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-foundry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.1",
|
|
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": {
|