A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
chore(release): point the editor at the mirror that now exists
yhhcf57d1812552
diff --git a/build-tools/utils/nativeTemplate.js b/build-tools/utils/nativeTemplate.jsindex c14ce95e2..2b19e33fd 100644--- a/build-tools/utils/nativeTemplate.js+++ b/build-tools/utils/nativeTemplate.js@@ -247,7 +247,10 @@ export const TEMPLATE_INDEX = 'native-templates.json';* do is fail and hand the download back to the origin.*/export const RELEASE_MIRROR_ENV = 'ESTELLA_RELEASE_MIRROR';-export const DEFAULT_RELEASE_MIRROR = '';+// The project's own mirror: an R2 bucket in APAC, which is where the reports of+// slow downloads come from. r2.dev is Cloudflare's built-in public URL and is rate+// limited — a custom domain replaces this string and nothing else.+export const DEFAULT_RELEASE_MIRROR = 'https://pub-48562c2257e64700ab9afda0436719a8.r2.dev';/** The release origin: where a version is published, and the last word on it. */export const RELEASE_ORIGIN = 'https://github.com/esengine/estella/releases/download';diff --git a/desktop/tests/release-mirror.test.ts b/desktop/tests/release-mirror.test.tsindex 38a897e48..e81f8115d 100644--- a/desktop/tests/release-mirror.test.ts+++ b/desktop/tests/release-mirror.test.ts@@ -15,6 +15,7 @@ import { downloadNativeTemplate } from '../electron/nativeTemplates';import { checkForUpdate } from '../electron/updateCheck';import {releaseAssetBase, releaseAssetBases, releaseMirrors, RELEASE_MIRROR_ENV,+ DEFAULT_RELEASE_MIRROR,TEMPLATE_INDEX, TEMPLATE_FORMAT, writeTemplateManifest, installedTemplateDir,} from '../../build-tools/utils/nativeTemplate.js';import { makeZip } from '../../build-tools/utils/zip.js';@@ -23,9 +24,19 @@ const VERSION = '9.9.9';const MIRROR = 'https://mirror.test/estella';describe('where a release is fetched from', () => {- it('is the origin alone when nothing is mirrored', () => {- expect(releaseMirrors({})).toEqual([]);- expect(releaseAssetBases(VERSION, {})).toEqual([releaseAssetBase(VERSION)]);+ it('is the built-in mirror, then the origin', () => {+ expect(releaseAssetBases(VERSION, {})).toEqual([+ `${DEFAULT_RELEASE_MIRROR}/v${VERSION}`,+ releaseAssetBase(VERSION),+ ]);+ });++ it('is the origin alone when the mirror is turned off', () => {+ // Explicitly empty, not unset: an offline or air-gapped install has to be able+ // to say "no mirror" without the build having to be different.+ expect(releaseMirrors({ [RELEASE_MIRROR_ENV]: '' })).toEqual([]);+ expect(releaseAssetBases(VERSION, { [RELEASE_MIRROR_ENV]: '' }))+ .toEqual([releaseAssetBase(VERSION)]);});it('puts each mirror before the origin, and lays a version out the same way', () => {