feat(certified-assets): publish v0.1.0 - #30
Closed
lwshang wants to merge 1 commit into
Closed
Conversation
lwshang
added a commit
to dfinity/certified-assets
that referenced
this pull request
Jun 16, 2026
Most users consume this repo through an **icp-cli recipe** rather than
the raw wasm bundle. This adds the infrastructure to **produce, test,
and publish** a new `@dfinity/certified-assets` recipe.
## What's here
**Produce — one source, two variants** (`crates/recipe-gen/`)
- `src/recipe.hbs.in` is the single template. The user-facing `{{ }}`
handlebars directives survive verbatim because the generator only swaps
two non-handlebars sentinels (`@@CANISTER_SOURCE@@` /
`@@PLUGIN_SOURCE@@`) via plain string substitution.
- `render_recipe(WasmSource::{Local,Release})` emits either a local-path
variant (for in-repo testing) or a release-URL + sha256 variant (for
publishing).
- Config fields: `dir` (singular — sync-core enforces exactly one
directory), `build`, `metadata`. No user `version` field: the recipe
release itself pins a matched canister+plugin pair.
- `make recipe-local` / `make recipe-release` wire it into the build.
**Test**
- 5 `recipe-gen` unit tests render every config combo through the same
`handlebars`/`serde_yaml` versions icp-cli uses and assert valid icp-cli
build/sync YAML (+ missing-`dir` errors, + release URL/sha pinning).
- 3 e2e tests (`crates/e2e/tests/recipe.rs`) deploy through the real
`icp` CLI via `file://` recipes pinning the freshly built wasm:
`recipe_basic`, `recipe_build_step`, `recipe_metadata`.
- `ci.yml` now installs `ic-wasm` (pinned `0.9.11`) so the metadata
recipe test runs ungated.
**Publish** — `scripts/publish-recipe.sh`
- Generates the release recipe (pinning the exact published `.sha256`),
prepares a branch in a sibling `icp-cli-recipes` clone, and opens the
PR. Idempotent prepare/push phases, non-destructive (dirty-tree guard,
fresh branch off `origin/main`, no auto-push without `--push`).
## Recipe PR
The companion recipe was published to the registry with this script:
**dfinity/icp-cli-recipes#30**.
## Notes
- New recipe name `certified-assets` (v1.x.y line), leaving the old
SDK-based `asset-canister` recipe untouched.
- After a `v<version>` release of this repo exists, run
`scripts/publish-recipe.sh v<version> --push`; after that PR merges, tag
`certified-assets-v<version>` in icp-cli-recipes to cut the recipe
release.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
raymondk
marked this pull request as draft
June 19, 2026 16:02
lwshang
added a commit
to dfinity/certified-assets
that referenced
this pull request
Jul 22, 2026
…ld (#112) Prepares this repo's recipe for public release in `icp-cli-recipes` and adds a new configuration field. ## Rename to `@dfinity/static-site` The published recipe is renamed from `@dfinity/certified-assets` to `@dfinity/static-site` across the publish script, recipe README, user docs, and doc comments. The recipe name only appears in a project's `canister.yaml`, so it should name the recipe's *input* (a built static site) — matching the name-by-input pattern of the sibling `@dfinity/rust` / `@dfinity/motoko` recipes — not the canister's role (already `name: frontend`). Repo/canister references (the `dfinity/certified-assets` repo, the `.did`, "the certified-assets canister wasm") are deliberately unchanged. ## New `presync` config field `presync` is an array of shell commands, analogous to `build`, but expanded into the **sync** section as a script step *before* the sync-plugin step. Sync steps run after the canister exists, so `icp-cli` exposes the deployed canister IDs to them: `ICP_CLI_CID`, `ICP_CLI_CID_<NAME>` (per project canister), `ICP_CLI_NETWORK`, and `ICP_CLI_ENVIRONMENT`. This lets a frontend build bake in the IDs it will call — something `build` cannot do (it runs before creation, with only `ICP_WASM_OUTPUT_PATH`). ## Ship + verify the recipe via the GitHub release - The release CI now runs `make recipe-release` and attaches the generated `recipe.hbs` (URL + sha256 pinned — the public form, not the local file-path variant) to the GitHub release. - `publish-recipe.sh` downloads that asset and commits it to the registry PR **verbatim** (instead of regenerating locally), and the PR links back to the release asset so reviewers can verify the two are identical. This drops the `cargo`/`recipe-gen` dependency from the publish path and removes any template-drift risk. ## Tests - `recipe-gen` unit tests: 6/6, incl. `local_with_presync` (asserts `presync` renders as a sync script step before the plugin step). - e2e recipe tests: 4/4, incl. `recipe_presync_env` — a live deploy whose pre-sync step reads `$ICP_CLI_CID` / `$ICP_CLI_CID_FRONTEND` into served assets, which are then fetched through the gateway (certified) and asserted to equal the frontend canister's own principal, proving the env vars are genuinely readable. ## Follow-ups (not in this PR) - After a `v<version>` release cuts, run `scripts/publish-recipe.sh v<version> --push` to open the `@dfinity/static-site` PR against `icp-cli-recipes`, and close the stale `@dfinity/certified-assets` [PR #30](dfinity/icp-cli-recipes#30). - Switch the `icp new` templates (icp-cli repo) to the new recipe and deprecate `@dfinity/asset-canister`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publishes the
certified-assetsrecipe at v0.1.0, pinning the canister and sync-plugin wasm from dfinity/certified-assets's v0.1.0 release.After merge, tag
certified-assets-v0.1.0in this repo to cut the recipe release.