Skip to content

Commit af3286d

Browse files
committed
Merge branch 'feat/multi-channel-install' of github.com:modelstudioai/cli into feat/multi-channel-install
2 parents 6465c4a + 467756b commit af3286d

4 files changed

Lines changed: 236 additions & 93 deletions

File tree

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
BAILIAN_OSS_REGION: ${{ secrets.BAILIAN_OSS_REGION }}
8080
BAILIAN_OSS_ENDPOINT: ${{ secrets.BAILIAN_OSS_ENDPOINT }}
8181
BAILIAN_RELEASE_PREFIX: ${{ secrets.BAILIAN_RELEASE_PREFIX }}
82+
BAILIAN_STATIC_PREFIX: ${{ secrets.BAILIAN_STATIC_PREFIX }}
8283
run: node tools/release/publish-stable.mjs ${{ inputs.package == 'knowledge-studio-cli' && '--knowledge' || '' }}
8384

8485
publish-channel:
@@ -135,4 +136,5 @@ jobs:
135136
BAILIAN_OSS_REGION: ${{ secrets.BAILIAN_OSS_REGION }}
136137
BAILIAN_OSS_ENDPOINT: ${{ secrets.BAILIAN_OSS_ENDPOINT }}
137138
BAILIAN_RELEASE_PREFIX: ${{ secrets.BAILIAN_RELEASE_PREFIX }}
139+
BAILIAN_STATIC_PREFIX: ${{ secrets.BAILIAN_STATIC_PREFIX }}
138140
run: node tools/release/publish-channel.mjs ${{ inputs.package == 'knowledge-studio-cli' && '--knowledge' || '' }} --channel "${{ inputs.channel }}"

packages/core/src/install/cdn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Layout under the base:
77
* v<version>/<asset>.zip —— immutable per-version binaries + SHA256SUMS
8-
* manifest.json —— stable pointer { latest, releasedAt, assets }
8+
* manifest.json —— stable pointer; same rolling-manifest shape as latest.json
99
* latest.json —— stable rolling manifest (os-arch keyed, sha256)
1010
* <channel>.json —— per-channel rolling manifests (beta versions)
1111
*

tools/release/lib/binary-release.mjs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
*
1212
* Re-runs are idempotent via `gh release upload --clobber` (see gh-release.mjs).
1313
* After the GitHub upload the same assets are pushed straight to OSS from the
14-
* runner, HEAD-reconciled, and (stable only) release/manifest.json is updated —
14+
* runner, HEAD-reconciled, and (stable only) release/manifest.json + latest.json
15+
* are rewritten with the SAME rolling-manifest body as channel `<channel>.json` —
1516
* all in-process, no external FC (see oss-direct-upload.mjs).
1617
*
1718
* Called by publish-stable.mjs / publish-channel.mjs.
@@ -20,14 +21,18 @@
2021
* node tools/release/lib/binary-release.mjs --mode channel --channel beta --dry-run
2122
*/
2223
import { existsSync, readdirSync, readFileSync } from "node:fs";
23-
import { basename, join, resolve } from "node:path";
24+
import { join, resolve } from "node:path";
2425
import { fileURLToPath } from "node:url";
2526
import { parseArgs as parseCliArgs } from "node:util";
2627
import { ROOT, readPackageJson, PACKAGES } from "./packages.mjs";
2728
import { buildBinaryArtifacts, matrixAssetNames } from "./binary-build.mjs";
2829
import { channelManifestFileName, normalizeModeChannel } from "./binary-options.mjs";
2930
import { ensureGh, GITHUB_REPOSITORY, upsertRelease } from "./gh-release.mjs";
30-
import { maintainReleaseManifest, mirrorReleaseAssetsToOss } from "./oss-direct-upload.mjs";
31+
import {
32+
maintainReleaseManifest,
33+
mirrorReleaseAssetsToOss,
34+
syncStaticFilesToOss,
35+
} from "./oss-direct-upload.mjs";
3136

3237
const DEFAULT_DIR = join(ROOT, "dist-bin");
3338

@@ -179,11 +184,14 @@ export async function releaseBinaryArtifacts(rawOptions = {}) {
179184
process.stdout.write(`[dry-run] ${dir} missing; planning expected assets\n`);
180185
planDryRunWithoutArtifacts({ version, mode, channel });
181186
const plans = ossMirrorPlans({ dir, version, mode, channel, files: null });
187+
await syncStaticFilesToOss({
188+
filePaths: [join(ROOT, "CHANGELOG.md"), join(ROOT, "CHANGELOG.zh.md")],
189+
dryRun: true,
190+
});
182191
await mirrorReleaseAssetsToOss({ plans, dryRun: true });
183192
if (mode === "stable") {
184193
await maintainReleaseManifest({
185194
tag: `v${version}`,
186-
assetNames: plans[0].paths.map((path) => basename(path)),
187195
channelJsonPath: null,
188196
dryRun: true,
189197
});
@@ -226,6 +234,11 @@ export async function releaseBinaryArtifacts(rawOptions = {}) {
226234
uploadChannel({ dir, version, channel, files, dryRun });
227235
}
228236

237+
// Sync changelogs (and other static files) to OSS before the binary mirror.
238+
await syncStaticFilesToOss({
239+
filePaths: [join(ROOT, "CHANGELOG.md"), join(ROOT, "CHANGELOG.zh.md")],
240+
dryRun,
241+
});
229242
// Push the exact Release assets straight to OSS from the runner, then
230243
// HEAD-reconcile. Stable releases additionally maintain release/manifest.json
231244
// (newer-version guard). Throws on failure — CI is the only OSS writer.
@@ -234,7 +247,6 @@ export async function releaseBinaryArtifacts(rawOptions = {}) {
234247
if (mode === "stable" && !mirror.skipped) {
235248
await maintainReleaseManifest({
236249
tag: `v${version}`,
237-
assetNames: plans[0].paths.map((path) => basename(path)),
238250
channelJsonPath: join(dir, rollingManifest),
239251
dryRun,
240252
});

0 commit comments

Comments
 (0)