mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 10:40:00 +08:00
Build documents and examples on master.
This commit is contained in:
parent
d805eb0648
commit
f80e20c4aa
21
.github/workflows/build.yaml
vendored
21
.github/workflows/build.yaml
vendored
@ -169,7 +169,7 @@ jobs:
|
|||||||
overwrite: true
|
overwrite: true
|
||||||
|
|
||||||
documentation:
|
documentation:
|
||||||
needs: package
|
if: github.ref == 'refs/heads/master'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout repository"
|
- name: "Checkout repository"
|
||||||
@ -190,9 +190,22 @@ jobs:
|
|||||||
run: >
|
run: >
|
||||||
mkdir build;
|
mkdir build;
|
||||||
cd build;
|
cd build;
|
||||||
emcmake cmake ..;
|
emcmake cmake ..
|
||||||
cmake --build . --target doc;
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
rsync -amv --include='*/' --include='*.html' --include='*.js' --include='*.wasm' --exclude='*' examples doc/doxygen/html;
|
-DFTXUI_BUILD_DOCS=ON
|
||||||
|
-DFTXUI_BUILD_EXAMPLES=ON
|
||||||
|
-DFTXUI_BUILD_TESTS=OFF
|
||||||
|
-DFTXUI_BUILD_TESTS_FUZZER=OFF
|
||||||
|
-DFTXUI_ENABLE_INSTALL=OFF;
|
||||||
|
cmake --build .;
|
||||||
|
rsync -amv
|
||||||
|
--include='*/'
|
||||||
|
--include='*.html'
|
||||||
|
--include='*.js'
|
||||||
|
--include='*.wasm'
|
||||||
|
--exclude='*'
|
||||||
|
examples
|
||||||
|
doc/doxygen/html;
|
||||||
|
|
||||||
- name: "Deploy"
|
- name: "Deploy"
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
@ -19,6 +19,7 @@ if (EMSCRIPTEN)
|
|||||||
get_property(EXAMPLES GLOBAL PROPERTY FTXUI::EXAMPLES)
|
get_property(EXAMPLES GLOBAL PROPERTY FTXUI::EXAMPLES)
|
||||||
foreach(file
|
foreach(file
|
||||||
"index.html"
|
"index.html"
|
||||||
|
"sw.js"
|
||||||
"run_webassembly.py")
|
"run_webassembly.py")
|
||||||
configure_file(${file} ${file})
|
configure_file(${file} ${file})
|
||||||
endforeach(file)
|
endforeach(file)
|
||||||
|
@ -5,6 +5,18 @@
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/xterm@4.18.0/lib/xterm.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/xterm@4.18.0/lib/xterm.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-webgl@0.11.4/lib/xterm-addon-webgl.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-webgl@0.11.4/lib/xterm-addon-webgl.min.js"></script>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@4.11.0/css/xterm.css"></link>
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@4.11.0/css/xterm.css"></link>
|
||||||
|
<!--Add COOP/COEP via a ServiceWorker to use SharedArrayBuffer-->
|
||||||
|
<script>
|
||||||
|
if ("serviceWorker" in navigator && !window.crossOriginIsolated) {
|
||||||
|
navigator.serviceWorker.register(new URL("./sw.js", location.href)).then(
|
||||||
|
registration => {
|
||||||
|
if (registration.active && !navigator.serviceWorker.controller) {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script id="example_script"></script>
|
<script id="example_script"></script>
|
||||||
|
23
examples/sw.js
Normal file
23
examples/sw.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// sw.js
|
||||||
|
self.addEventListener("install", () => self.skipWaiting());
|
||||||
|
self.addEventListener("activate", e => e.waitUntil(self.clients.claim()));
|
||||||
|
self.addEventListener("fetch", e => {
|
||||||
|
if (e.request.mode != 'navigate')
|
||||||
|
return;
|
||||||
|
|
||||||
|
e.respondWith((async () => {
|
||||||
|
const response = await fetch(e.request);
|
||||||
|
|
||||||
|
const newHeaders = new Headers(response.headers);
|
||||||
|
newHeaders.set("Cross-Origin-Embedder-Policy", "require-corp");
|
||||||
|
newHeaders.set("Cross-Origin-Opener-Policy", "same-origin");
|
||||||
|
|
||||||
|
const moddedResponse = new Response(response.body, {
|
||||||
|
status: response.status,
|
||||||
|
statusText: response.statusText,
|
||||||
|
headers: newHeaders,
|
||||||
|
});
|
||||||
|
|
||||||
|
return moddedResponse;
|
||||||
|
})());
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user