Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 41 additions & 0 deletions .github/workflows/single-file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create single file build

on:
push:
branches: ["*"]
workflow_dispatch:

concurrency:
group: "pages"
cancel-in-progress: false
Comment thread
NellowTCS marked this conversation as resolved.

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "22" # Using latest Node 22 for 2026 compatibility

- name: Install dependencies
working-directory: Build
run: npm i

- name: Build
working-directory: Build
run: npm run build:single

- name: Rename for distribution
working-directory: Build/dist
run: mv index.html HTMLRunner.html

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: HTMLRunner-Standalone
path: Build/dist/HTMLRunner.html
if-no-files-found: error

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +14 to +41
44 changes: 21 additions & 23 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
# .github/workflows/static.yml
name: Deploy static content to Pages
# Simple workflow for deploying static content to GitHub Pages
name: Deploy browser build to GitHub Pages

on:
push:
branches: ["main"]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
contents: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: true
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "20"

- name: Run build script
run: |
chmod +x Build/Buildscripts/build.sh
./Build/Buildscripts/build.sh
- name: Install dependencies
working-directory: Build
run: npm i

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'Build/dist'
- name: Build
working-directory: Build
run: npm run build

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Deploy browser build to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: Build/dist
16 changes: 0 additions & 16 deletions Build/Buildscripts/build-all.sh

This file was deleted.

67 changes: 0 additions & 67 deletions Build/Buildscripts/build-inline.sh

This file was deleted.

21 changes: 0 additions & 21 deletions Build/Buildscripts/build.sh

This file was deleted.

59 changes: 2 additions & 57 deletions index.html → Build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTMLRunner</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.png">
<link rel="apple-touch-icon" href="favicon.png">
<link rel="manifest" href="manifest.json">
<!-- Font Awesome CDN -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<!-- CodeMirror CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.7/codemirror.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.7/theme/monokai.min.css">
<!-- CodeMirror Addons CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.7/addon/lint/lint.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.7/addon/dialog/dialog.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.7/addon/search/matchesonscrollbar.min.css">
<!-- Main Styles-->
<!-- prettier-ignore-start -->
<link rel="stylesheet" data-inline="true" href="styles.css">
<!-- prettier-ignore-end -->
<link rel="stylesheet" href="./styles/styles.css">
</head>
<body>
<div class="loading" id="loading">
Expand Down Expand Up @@ -66,47 +52,6 @@
</div>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
// Register the service worker
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("service-worker.js");
}

let deferredPrompt;
const installButton = document.getElementById("install-button");

// Listen for the install prompt
window.addEventListener("beforeinstallprompt", (e) => {
e.preventDefault();
deferredPrompt = e;
installButton.hidden = false;
});

// Handle install button click
installButton.addEventListener("click", async () => {
const isStandalone = window.matchMedia("(display-mode: standalone)").matches || window.navigator.standalone;

if (isStandalone) {
console.log("App is already installed");
return;
}

if (deferredPrompt) {
deferredPrompt.prompt();
const { outcome } = await deferredPrompt.userChoice;
deferredPrompt = null;
console.log(outcome === "accepted" ? "User accepted install prompt" : "User dismissed install prompt");
} else {
if (window.matchMedia("(display-mode: browser)").matches) {
window.location.assign("chrome://apps/");
}
}
});
});
</script>
<!-- prettier-ignore-start -->
<script data-inline="true" src="main.js"></script>
<!-- prettier-ignore-end -->
<script type="module" src="./src/main.ts"></script>
</body>
</html>
Loading
Loading