@norskvideo/ctl-dev-kit 0.2.120 → 0.2.122

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.
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env bash
2
2
  # Repin the norsk-ctl daemon in flake.nix to a channel version. Resolves the
3
- # version (default: the `latest` channel), fetches each platform's sha256
4
- # sidecar, converts to SRI, and rewrites `ctlVersion` + the four `hash =` lines
5
- # in flake.nix in place. Run from anywhere; targets the flake.nix beside it.
3
+ # version (default: the `rc` channel, which the products' nightly bump
4
+ # follows), fetches each platform's sha256 sidecar, converts to SRI, and
5
+ # rewrites `ctlVersion` + the four `hash =` lines in flake.nix in place. Run
6
+ # from anywhere; targets the flake.nix beside it.
6
7
  #
7
- # refresh-ctl-pin.sh # pin to the current `latest`
8
+ # refresh-ctl-pin.sh # pin to the current `rc`
8
9
  # refresh-ctl-pin.sh 0.1.0-2026-07-27-... # pin to an explicit version
9
10
  set -euo pipefail
10
11
 
@@ -12,7 +13,7 @@ here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
13
  flake="$here/flake.nix"
13
14
  base="https://s3.eu-west-1.amazonaws.com/norsk.video/norsk-ctl"
14
15
 
15
- ver="${1:-$(curl -fsSL "$base/latest")}"
16
+ ver="${1:-$(curl -fsSL "$base/rc")}"
16
17
  echo "pinning norsk-ctl -> $ver"
17
18
 
18
19
  declare -A plat=(
@@ -21,7 +21,7 @@ on:
21
21
  schedule:
22
22
  - cron: "17 4 * * *"
23
23
  # Sent, through ci-workflows' fan-out, when something this repo pins is
24
- # published (the norsk nightly, Studio's manifest pair, norsk-ctl latest), so
24
+ # published (the norsk nightly, Studio's manifest pair, norsk-ctl rc), so
25
25
  # the pins move the same day rather than at the next 04:17. client_payload
26
26
  # may name components; it defaults to the pins.
27
27
  repository_dispatch:
@@ -285,7 +285,7 @@ jobs:
285
285
  # Then every occurrence of the old string moves, lockfile aside --
286
286
  # including the engine image ref the product's template launches. It also
287
287
  # moves flake.nix's ctlVersion, the norsk-ctl the product's CI tiers run,
288
- # to the `latest` channel (ctl-pinned-in-repo.test.ts).
288
+ # to the `rc` channel (ctl-pinned-in-repo.test.ts).
289
289
  #
290
290
  # A REFUSAL refuses the pins alone: the step says why and moves nothing,
291
291
  # and the night's other components still reach their PR.
@@ -311,8 +311,8 @@ jobs:
311
311
  ctl_base="https://s3.eu-west-1.amazonaws.com/norsk.video/norsk-ctl"
312
312
  old_ctl="$( { grep -oE 'ctlVersion = "[^"]+"' flake.nix 2>/dev/null || true; } | head -1 | sed -E 's/.*"(.*)"/\1/')"
313
313
  [ -n "$old_ctl" ] || refuse "flake.nix pins no ctlVersion. CI runs the norsk-ctl it names, so add ctlVersion = \"<version>\"; to flake.nix."
314
- new_ctl="$(curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 "$ctl_base/latest" || true)"
315
- [ -n "$new_ctl" ] || refuse "could not resolve norsk-ctl's latest channel"
314
+ new_ctl="$(curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 "$ctl_base/rc" || true)"
315
+ [ -n "$new_ctl" ] || refuse "could not resolve norsk-ctl's rc channel"
316
316
  # An sdk-app's flake fetches no daemon, so normally no hashes; any
317
317
  # platform it does fetch is resolved now, before anything moves.
318
318
  declare -A ctl_sri=()
@@ -6,7 +6,8 @@
6
6
  # 2. ctl-packages: the @norskvideo/ctl-* and moq-* family to npm `latest`;
7
7
  # 3. pins: the engine and Studio image pair from the nightly entry of
8
8
  # norsk-studio's channel manifest, and flake.nix's norsk-ctl pin to the
9
- # `latest` channel.
9
+ # `rc` channel (hourly builds of main that passed ctl's release checks;
10
+ # `latest` moves only when ctl is blessed).
10
11
  # Then ONE lockfile refresh across every install root, the quick gate (drift,
11
12
  # lint, typecheck, unit), and ONE PR on bump/nightly, force-pushed, listing
12
13
  # every component that moved, from and to, and anything refused, and why.
@@ -45,7 +46,7 @@ on:
45
46
  schedule:
46
47
  - cron: "17 4 * * *"
47
48
  # Sent, through ci-workflows' fan-out, when something this repo pins is
48
- # published (the norsk nightly, Studio's manifest pair, norsk-ctl latest), so
49
+ # published (the norsk nightly, Studio's manifest pair, norsk-ctl rc), so
49
50
  # the pins move the same day rather than at the next 04:17. client_payload
50
51
  # may name components; it defaults to the pins.
51
52
  repository_dispatch:
@@ -301,7 +302,7 @@ jobs:
301
302
  # PINS last: the {engine, studio image} pair from the nightly entry of
302
303
  # norsk-studio's channel manifest -- the pair studio TESTED together --
303
304
  # never from the two channels separately, plus flake.nix's norsk-ctl pin
304
- # (ctlVersion + the per-platform hashes) to the `latest` channel. That pin
305
+ # (ctlVersion + the per-platform hashes) to the `rc` channel. That pin
305
306
  # is not dev-only: every CI tier runs the norsk-ctl it names, so a
306
307
  # product's result belongs to a commit (ctl-pinned-in-repo.test.ts).
307
308
  # Version discovery anchors on manifest.seed.json (the machine-writable
@@ -339,8 +340,8 @@ jobs:
339
340
  ctl_base="https://s3.eu-west-1.amazonaws.com/norsk.video/norsk-ctl"
340
341
  old_ctl="$( { grep -oE 'ctlVersion = "[^"]+"' flake.nix 2>/dev/null || true; } | head -1 | sed -E 's/.*"(.*)"/\1/')"
341
342
  [ -n "$old_ctl" ] || refuse "flake.nix pins no ctlVersion. CI runs the norsk-ctl it names, so add ctlVersion = \"<version>\"; to flake.nix."
342
- new_ctl="$(curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 "$ctl_base/latest" || true)"
343
- [ -n "$new_ctl" ] || refuse "could not resolve norsk-ctl's latest channel"
343
+ new_ctl="$(curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 "$ctl_base/rc" || true)"
344
+ [ -n "$new_ctl" ] || refuse "could not resolve norsk-ctl's rc channel"
344
345
  # The per-platform hash of each platform the flake fetches the daemon
345
346
  # for (a Studio product's flake fetches all four; an sdk-app's none).
346
347
  # Fetched now, not after the engine has moved: a missing sidecar used
@@ -36,6 +36,9 @@ on:
36
36
 
37
37
  permissions:
38
38
  contents: read
39
+ # GitHub Packages and ghcr need a token even to read norsk's dev packages and
40
+ # engine (the dev SDK lane below).
41
+ packages: read
39
42
 
40
43
  # Key the group on event_name so a push never queues behind an in-flight
41
44
  # ctl-candidate validation. Nothing cancels a run in progress
@@ -266,6 +269,25 @@ jobs:
266
269
  - name: Install dependencies
267
270
  run: nix develop .#build --command bun install --frozen-lockfile
268
271
 
272
+ # The dev SDK lane, for a repo that opts in with .github/ci/sdk-dev.sh
273
+ # (norsk-relay), as checks.yml runs it: on a push to main the norsk SDKs
274
+ # are reinstalled from norsk's dev packages (every green push to norsk
275
+ # main, on GitHub Packages) and the script names the engine built from
276
+ # the same commit as NORSK_IMAGE, so the image and the journey run
277
+ # against norsk as it is now, not the nightly the tree pins. Not for a
278
+ # dispatch: pins-bumped asks about the pin, ctl-candidate about a ctl
279
+ # build, and both score against what ships. The committed pins are
280
+ # untouched. The image build needs the dev registry too: the repo's
281
+ # build script hands it the ~/.npmrc sdk-dev.sh wrote, as a build secret.
282
+ - name: Norsk SDKs and engine from norsk's dev builds
283
+ if: ${{ github.event_name == 'push' && hashFiles('.github/ci/sdk-dev.sh') != '' }}
284
+ env:
285
+ GITHUB_TOKEN: ${{ github.token }}
286
+ run: |
287
+ set -euo pipefail
288
+ nix develop .#build --command bash .github/ci/sdk-dev.sh
289
+ echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
290
+
269
291
  # Before anything is built or launched: does this licence actually name
270
292
  # this product? `product add` refuses one it does not, and that refusal
271
293
  # reaches the log as a 60-second readiness timeout indistinguishable from
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.2.120",
3
+ "version": "0.2.122",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",