Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 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
3b6dd1e
update comment
jjspace Oct 14, 2025
da2dd8a
update function names
jjspace Oct 20, 2025
4530967
switch dev-sandcastle to main branch
jjspace Oct 21, 2025
b74d62d
Merge remote-tracking branch 'origin/main' into sandcastle-build-updates
jjspace Oct 23, 2025
ba045e7
convert to options params for clarity
jjspace Oct 23, 2025
b478c3f
rename arguments and functions for clarity
jjspace Oct 24, 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@v6
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/
# Publish the simple viewer app to the bucket for https://cesium.com/cesiumjs/cesium-viewer/
# 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
6 changes: 3 additions & 3 deletions .github/workflows/sandcastle-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: sandcastle-dev
on:
push:
branches:
- 'cesium.com'
- "main"
jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -20,15 +20,15 @@ jobs:
- name: install node 22
uses: actions/setup-node@v6
with:
node-version: '22'
node-version: "22"
- name: npm install
run: npm install
- name: build website release
run: npm run website-release
- 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
262 changes: 140 additions & 122 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
createCombinedSpecList,
createJsHintOptions,
defaultESBuildOptions,
buildSandcastleApp,
} 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 All @@ -55,7 +56,7 @@ function getWorkspaces(onlyDependencies = false) {
}

const devDeployUrl = process.env.DEPLOYED_URL;
const isProduction = process.env.PROD;
const isProduction = process.env.PROD === "true";

//Gulp doesn't seem to have a way to get the currently running tasks for setting
//per-task variables. We use the command line argument here to detect which task is being run.
Expand Down Expand Up @@ -287,10 +288,19 @@ export async function buildTs() {
await createTypeScriptDefinitions();
}

export function buildApps() {
return Promise.all([buildCesiumViewer(), buildSandcastle()]);
export async function buildSandcastle() {
return buildSandcastleApp({
outputToBuildDir: isProduction,
includeDevelopment: !isProduction,
});
}

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

const filesToClean = [
"Source/Cesium.js",
"Source/Shaders/**/*.js",
Expand Down Expand Up @@ -582,121 +592,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 buildSandcastleStep() {
return buildSandcastleApp({
outputToBuildDir: false,
includeDevelopment: 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 +1257,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 +1270,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 Expand Up @@ -1631,7 +1649,7 @@ export async function buildThirdParty() {
return writeFile("ThirdParty.json", JSON.stringify(licenseJson, null, 2));
}

async function buildSandcastle() {
async function buildLegacySandcastle() {
const streams = [];
let appStream = gulp.src(
[
Expand Down
Loading
Loading