Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f490f63
central sandcastle build function, bundle esm packages
jjspace Sep 19, 2025
814cb73
remove duplicated configs
jjspace Sep 19, 2025
f7c4d62
dont include dev sandcastles in prod
jjspace Sep 19, 2025
aabcb3d
add commit sha to build for CI
jjspace Sep 19, 2025
f3f4075
build TS for sandcastle
jjspace Sep 19, 2025
4de8de1
Merge remote-tracking branch 'origin/main' into sandcastle-build-updates
jjspace Sep 19, 2025
dcc4ec1
fix ci build double //
jjspace Sep 23, 2025
97f606d
move import inside module declaration in package types
jjspace Sep 23, 2025
4aab565
Use proper URLs for import statements
javagl Sep 23, 2025
2fcefac
make sure imports are strings
jjspace Sep 23, 2025
20f3edc
Merge pull request #12911 from CesiumGS/sandcastle-build-updates-windows
jjspace Sep 23, 2025
d350020
Merge remote-tracking branch 'origin/main' into sandcastle-build-updates
jjspace Sep 26, 2025
63c8ccb
clarify build option
jjspace Sep 26, 2025
1bd41e9
further isolate sandcastle build process
jjspace Sep 29, 2025
d83fb76
switch from ts api to tsc cli
jjspace Sep 29, 2025
26a011d
remove extra logs
jjspace Sep 30, 2025
0f7a9c8
switch deployed sandcastle directory
jjspace Sep 30, 2025
c708661
Merge remote-tracking branch 'origin/main' into sandcastle-build-updates
jjspace Oct 3, 2025
b586c14
Merge remote-tracking branch 'origin/main' into sandcastle-build-updates
jjspace Oct 7, 2025
c4e8eea
switch to relative routes for non-prod builds
jjspace Oct 7, 2025
aaf4ae1
move and trim build config
jjspace Oct 7, 2025
b695f5d
adjust prod GH workflow
jjspace Oct 7, 2025
61d330a
correctly build sandcastle for zip file
jjspace Oct 7, 2025
f3ecf5b
build sandcastle on server start when it doesn't exist
jjspace Oct 7, 2025
00dce5a
update release index url to new sandcastle
jjspace Oct 7, 2025
dde0e07
small cleanup, remove excess changes
jjspace Oct 7, 2025
fd85408
adjust config structure
jjspace Oct 7, 2025
bee0278
Merge remote-tracking branch 'origin/main' into sandcastle-build-updates
jjspace Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: deploy
on:
push:
branches-ignore:
- 'cesium.com'
- "cesium.com"
- production
concurrency:
group: deploy-${{ github.ref }}
Expand All @@ -22,14 +22,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
BASE_URL: /cesium/${{ github.ref_name }}/
DEPLOYED_URL: https://ci-builds.cesium.com/cesium/${{ github.ref_name }}/
steps:
- uses: actions/checkout@v5
- name: install node 22
uses: actions/setup-node@v5
with:
node-version: '22'
node-version: "22"
- name: npm install
run: npm install
- name: set the version in package.json
Expand All @@ -42,8 +41,6 @@ jobs:
run: npm pack --workspaces &> /dev/null
- name: build apps
run: npm run build-apps
- name: build sandcastle v2
run: npm run build-ci -w packages/sandcastle -- -l warn
- uses: ./.github/actions/verify-package
- name: deploy to s3
if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ jobs:
run: npm install
- name: build website release
run: npm run website-release
- name: build apps
run: npm run build-apps
- name: build types
run: npm run build-ts
- name: build prod sandcastle
run: npm run build-prod -w packages/sandcastle -- -l warn
- name: build apps
run: npm run build-apps
- name: deploy to cesium.com
if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
# Download zip from the Github release and unzip to Build/release/
# Publish that unzipped code to the bucket for https://cesium.com/downloads/cesiumjs/releases/[version]/... urls
# Publish the documentation files to the bucket for https://cesium.com/learn/cesiumjs/ref-doc/... urls
# Publish the simple viewer app
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggetz do you know where the CesiumViewer app is deployed/hosted?

# Publish sandcastle to the bucket for https://sandcastle.cesium.com/
run: |
curl -LO $(curl https://api.github.com/repos/CesiumGS/cesium/releases/latest -H "Authorization: ${GITHUB_TOKEN}" | jq -r '.assets[0].browser_download_url')
unzip Cesium-$(cat package.json | jq -r '.version' | sed 's/\.0$//').zip -d Build/release/ -x "Apps"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sandcastle-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: build types
run: npm run build-ts
- name: build prod sandcastle
run: npm run build-prod -w packages/sandcastle -- -l warn
run: npm run build-sandcastle
- name: deploy to dev-sandcastle.cesium.com
if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
run: |
Expand Down
263 changes: 142 additions & 121 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import {
createCombinedSpecList,
createJsHintOptions,
defaultESBuildOptions,
buildSandcastleGallery,
buildNewSandcastleApp,
} from "./scripts/build.js";

// Determines the scope of the workspace packages. If the scope is set to cesium, the workspaces should be @cesium/engine.
Expand Down Expand Up @@ -287,9 +289,20 @@ export async function buildTs() {
await createTypeScriptDefinitions();
}

export function buildApps() {
return Promise.all([buildCesiumViewer(), buildSandcastle()]);
}
export const buildNewSandcastle = gulp.series(
async function buildSandcastleApp() {
return buildNewSandcastleApp(isProduction);
},
async function buildGallery() {
return buildSandcastleGallery(!isProduction);
},
);

export const buildApps = gulp.parallel(
buildCesiumViewer,
buildSandcastle,
buildNewSandcastle,
);

const filesToClean = [
"Source/Cesium.js",
Expand Down Expand Up @@ -582,121 +595,129 @@ async function pruneScriptsForZip(packageJsonPath) {
});
}

export const makeZip = gulp.series(release, async function createZipFile() {
//For now we regenerate the JS glsl to force it to be unminified in the release zip
//See https://github.com/CesiumGS/cesium/pull/3106#discussion_r42793558 for discussion.
await glslToJavaScript(false, "Build/minifyShaders.state", "engine");

const packageJsonSrc = await pruneScriptsForZip("package.json");
const enginePackageJsonSrc = await pruneScriptsForZip(
"packages/engine/package.json",
);
const widgetsPackageJsonSrc = await pruneScriptsForZip(
"packages/widgets/package.json",
);
export const makeZip = gulp.series(
release,
async function buildSandcastleApp() {
return buildNewSandcastleApp(false);
},
async function buildGallery() {
return buildSandcastleGallery(false);
},
async function createZipFile() {
//For now we regenerate the JS glsl to force it to be unminified in the release zip
//See https://github.com/CesiumGS/cesium/pull/3106#discussion_r42793558 for discussion.
await glslToJavaScript(false, "Build/minifyShaders.state", "engine");

const packageJsonSrc = await pruneScriptsForZip("package.json");
const enginePackageJsonSrc = await pruneScriptsForZip(
"packages/engine/package.json",
);
const widgetsPackageJsonSrc = await pruneScriptsForZip(
"packages/widgets/package.json",
);

const src = gulp
.src("index.release.html")
.pipe(
gulpRename((file) => {
if (file.basename === "index.release") {
file.basename = "index";
}
}),
)
.pipe(enginePackageJsonSrc)
.pipe(widgetsPackageJsonSrc)
.pipe(packageJsonSrc)
.pipe(
gulpRename((file) => {
if (file.basename === "package.noprepare") {
file.basename = "package";
}
}),
)
.pipe(
gulp.src(
[
"Build/Cesium/**",
"Build/CesiumUnminified/**",
"Build/Documentation/**",
"Build/Specs/**",
"Build/package.json",
"packages/engine/Build/**",
"packages/widgets/Build/**",
"!Build/Specs/e2e/**",
"!Build/InlineWorkers.js",
"!packages/engine/Build/Specs/**",
"!packages/widgets/Build/Specs/**",
"!packages/engine/Build/minifyShaders.state",
],
{
encoding: false,
base: ".",
},
),
)
.pipe(
gulp.src(
[
"Apps/**",
"Apps/Sandcastle/.jshintrc",
"packages/engine/index.js",
"packages/engine/index.d.ts",
"packages/engine/LICENSE.md",
"packages/engine/README.md",
"packages/engine/Source/**",
"packages/widgets/index.js",
"packages/widgets/index.d.ts",
"packages/widgets/LICENSE.md",
"packages/widgets/README.md",
"packages/widgets/Source/**",
"Source/**",
"Specs/**",
"ThirdParty/**",
"scripts/**",
"favicon.ico",
".prettierignore",
"eslint.config.js",
"gulpfile.js",
"server.js",
"index.cjs",
"LICENSE.md",
"CHANGES.md",
"README.md",
"web.config",
"!**/*.gitignore",
"!Specs/e2e/*-snapshots/**",
"!Apps/Sandcastle/gallery/development/**",
"!Apps/Sandcastle2/**",
],
{
encoding: false,
base: ".",
},
),
)
.pipe(
gulpTap(function (file) {
// Work around an issue with gulp-zip where archives generated on Windows do
// not properly have their directory executable mode set.
// see https://github.com/sindresorhus/gulp-zip/issues/64#issuecomment-205324031
if (file.isDirectory()) {
file.stat.mode = parseInt("40777", 8);
}
}),
)
.pipe(gulpZip(`Cesium-${version}.zip`))
.pipe(gulp.dest("."));
const src = gulp
.src("index.release.html")
.pipe(
gulpRename((file) => {
if (file.basename === "index.release") {
file.basename = "index";
}
}),
)
.pipe(enginePackageJsonSrc)
.pipe(widgetsPackageJsonSrc)
.pipe(packageJsonSrc)
.pipe(
gulpRename((file) => {
if (file.basename === "package.noprepare") {
file.basename = "package";
}
}),
)
.pipe(
gulp.src(
[
"Build/Cesium/**",
"Build/CesiumUnminified/**",
"Build/Documentation/**",
"Build/Specs/**",
"Build/package.json",
"packages/engine/Build/**",
"packages/widgets/Build/**",
"!Build/Specs/e2e/**",
"!Build/InlineWorkers.js",
"!packages/engine/Build/Specs/**",
"!packages/widgets/Build/Specs/**",
"!packages/engine/Build/minifyShaders.state",
],
{
encoding: false,
base: ".",
},
),
)
.pipe(
gulp.src(
[
"Apps/**",
"Apps/Sandcastle/.jshintrc",
"packages/engine/index.js",
"packages/engine/index.d.ts",
"packages/engine/LICENSE.md",
"packages/engine/README.md",
"packages/engine/Source/**",
"packages/widgets/index.js",
"packages/widgets/index.d.ts",
"packages/widgets/LICENSE.md",
"packages/widgets/README.md",
"packages/widgets/Source/**",
"Source/**",
"Specs/**",
"ThirdParty/**",
"scripts/**",
"favicon.ico",
".prettierignore",
"eslint.config.js",
"gulpfile.js",
"server.js",
"index.cjs",
"LICENSE.md",
"CHANGES.md",
"README.md",
"web.config",
"!**/*.gitignore",
"!Specs/e2e/*-snapshots/**",
"!Apps/Sandcastle/gallery/development/**",
],
{
encoding: false,
base: ".",
},
),
)
.pipe(
gulpTap(function (file) {
// Work around an issue with gulp-zip where archives generated on Windows do
// not properly have their directory executable mode set.
// see https://github.com/sindresorhus/gulp-zip/issues/64#issuecomment-205324031
if (file.isDirectory()) {
file.stat.mode = parseInt("40777", 8);
}
}),
)
.pipe(gulpZip(`Cesium-${version}.zip`))
.pipe(gulp.dest("."));

await finished(src);
await finished(src);

rimraf.sync("./package.noprepare.json");
rimraf.sync("./packages/engine/package.noprepare.json");
rimraf.sync("./packages/widgets/package.noprepare.json");
rimraf.sync("./package.noprepare.json");
rimraf.sync("./packages/engine/package.noprepare.json");
rimraf.sync("./packages/widgets/package.noprepare.json");

return src;
});
return src;
},
);

export async function deploySetVersion() {
const buildVersion = argv.buildVersion;
Expand Down Expand Up @@ -1239,13 +1260,6 @@ function generateTypeScriptDefinitions(
"raiseEvent(...arguments: Parameters<Listener>): void;",
);

// Wrap the source to actually be inside of a declared cesium module
// and add any workaround and private utility types.
source = `declare module "@${scope}/${workspaceName}" {
${source}
}
`;

if (importModules) {
let imports = "";
Object.keys(importModules).forEach((workspace) => {
Expand All @@ -1259,6 +1273,13 @@ ${source}
source = imports + source;
}

// Wrap the source to actually be inside of a declared cesium module
// and add any workaround and private utility types.
source = `declare module "@${scope}/${workspaceName}" {
${source}
}
`;

// Write the final source file back out
writeFileSync(definitionsPath, source);

Expand Down
2 changes: 1 addition & 1 deletion index.release.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h2>Local links</h2>
</td>
</tr>
<tr>
<td><a href="Apps/Sandcastle/index.html">Sandcastle</a></td>
<td><a href="Apps/Sandcastle2/index.html">Sandcastle</a></td>
<td>
Cesium's live code editor and example gallery. Browse examples
highlighting features of the Cesium API and edit and run them
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"build-ts": "gulp buildTs",
"build-third-party": "gulp buildThirdParty",
"build-apps": "gulp buildApps",
"build-sandcastle": "npm run build-app --workspace packages/sandcastle",
"build-sandcastle": "gulp buildNewSandcastle",
"clean": "gulp clean",
"cloc": "gulp cloc",
"coverage": "gulp coverage",
Expand Down Expand Up @@ -171,4 +171,4 @@
}
}
}
}
}
Loading
Loading