Skip to content

feat(certified-assets): publish v0.1.0 - #30

Closed
lwshang wants to merge 1 commit into
mainfrom
certified-assets-v0.1.0
Closed

feat(certified-assets): publish v0.1.0#30
lwshang wants to merge 1 commit into
mainfrom
certified-assets-v0.1.0

Conversation

@lwshang

@lwshang lwshang commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Publishes the certified-assets recipe 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.0 in this repo to cut the recipe release.

@lwshang
lwshang requested a review from a team as a code owner June 16, 2026 15:01
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
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>
@lwshang lwshang closed this Jul 22, 2026
@lwshang
lwshang deleted the certified-assets-v0.1.0 branch July 22, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant