Skip to content

Commit

Permalink
Deploying to gh-pages from @ 09e7bd0 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
sdasda7777 committed Jan 24, 2024
0 parents commit 35c5fbf
Show file tree
Hide file tree
Showing 13 changed files with 183 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

# Author: emilk, https://github.com/emilk/eframe_template/blob/master/.github/workflows/pages.yml

name: Github Pages

# By default, runs if you push to master. keeps your deployed app in sync with master branch.
on:
push:
branches:
- main
# to only run when you do a new github release, comment out above part and uncomment the below trigger.
# on:
# release:
# types:
# - published

permissions:
contents: write # for committing to gh-pages branch.

jobs:
build-github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 # repo checkout
- uses: actions-rs/toolchain@v1 # get rust toolchain for wasm
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Rust Cache # cache the rust build artefacts
uses: Swatinem/rust-cache@v1
- name: Download and install Trunk binary
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
- name: Build # build
# "${GITHUB_REPOSITORY#*/}" evaluates into the name of the repository
# using --public-url something will allow trunk to modify all the href paths like from favicon.ico to repo_name/favicon.ico .
# this is necessary for github pages where the site is deployed to username.github.io/repo_name and all files must be requested
# relatively as eframe_template/favicon.ico. if we skip public-url option, the href paths will instead request username.github.io/favicon.ico which
# will obviously return error 404 not found.
run: ./trunk build --release --public-url "${GITHUB_REPOSITORY#*/}"
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
# this option will not maintain any history of your previous pages deployment
# set to false if you want all page build to be committed to your gh-pages branch history
single-commit: true
25 changes: 25 additions & 0 deletions .github/workflows/rust_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Rust Release

on:
release:
types: [created]

jobs:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [ {name: x86_64-pc-windows-gnu} ]
steps:
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
TOOLCHAIN_VERSION: nightly
RUSTTARGET: ${{ matrix.target.name }}
STATIC_LINKING: true
EXTRA_FILES: "README.md LICENSE config.toml"
55 changes: 55 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

# Default view settings
show_timer_miliseconds = false
show_delta = true
show_neighbors = true
unlimited_zoom = false # enabling may lead to extreme increase in memory usage
probe_marked = false
tile_spacings = [0.0, 0.0, 10.0, 10.0]

# YELLOW, BROWN, LIGHT_GREEN, WHITE, KHAKI, DARK_BLUE, DARK_GREEN, GOLD
highlight_colors = [ "#FFFF00", "#A52A2A", "#90EE90", "#FFFFFF", "#F0E68C", "#000088", "#006400", "#FFD700" ]

# Default values for a new game
default_preset = 6

[[preset]]
name = "2D Minesweeper - Beginner"
size = [9, 9, 1, 1, 1, 1]
mines = 10

[[preset]]
name = "2D Minesweeper - Intermediate"
size = [16, 16, 1, 1, 1, 1]
mines = 40

[[preset]]
name = "2D Minesweeper - Expert"
size = [30, 16, 1, 1, 1, 1]
mines = 99

[[preset]]
name = "3D Minesweeper - Rubik"
size = [3, 3, 3, 1, 1, 1]
mines = 5

[[preset]]
name = "4D Minesweeper - Sudoku"
size = [3, 3, 3, 3, 1, 1]
mines = 15

[[preset]]
name = "4D Minesweeper - Elevator"
size = [4, 4, 3, 4, 1, 1]
wrap = [false, false, false, true, false, false]
mines = 15

[[preset]]
name = "4D Minesweeper - 4^4"
size = [4, 4, 4, 4, 1, 1]
mines = 20

[[preset]]
name = "6D Minesweeper - 3^6"
size = [3, 3, 3, 3, 3, 3]
mines = 60
Binary file added favicon-f402c8741ce815ec.ico
Binary file not shown.
Binary file added icon-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon_ios_touch_192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><meta content="text/html; charset=utf-8" http-equiv=Content-Type><meta content="width=device-width,initial-scale=1.0,user-scalable=no" name=viewport><title>eframe template</title><script type=module>import a,*as b from"/minesweeper6d/minesweeper6d-403ce4580ec37bba.js";a(`/minesweeper6d/minesweeper6d-403ce4580ec37bba_bg.wasm`);window.wasmBindings=b</script><base href=/minesweeper6d/><link href=/minesweeper6d/favicon-f402c8741ce815ec.ico integrity=sha384-jNOAE6jgE03LznIulCTVP6BH4NrTuROFjP9wj8bV1UUMJKtZAvstFpIAP3PDcFpx rel=icon><link href=manifest.json rel=manifest><link href=icon_ios_touch_192.png rel=apple-touch-icon><meta media="(prefers-color-scheme: light)" content=white name=theme-color><meta media="(prefers-color-scheme: dark)" content=#404040 name=theme-color><style>html{touch-action:manipulation}body{background:#909090}@media (prefers-color-scheme:dark){body{background:#404040}}html,body{width:100%;height:100%;overflow:hidden;margin:0!important;padding:0!important}canvas{margin-left:auto;margin-right:auto;display:block;position:absolute;top:0%;left:50%;transform:translate(-50%)}.centered{color:#f0f0f0;text-align:center;margin-left:auto;margin-right:auto;font-family:Ubuntu-Light,Helvetica,sans-serif;font-size:24px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.lds-dual-ring{width:24px;height:24px;display:inline-block}.lds-dual-ring:after{content:" ";border:3px solid #fff;border-color:#fff #0000;border-radius:50%;width:24px;height:24px;margin:0;animation:1.2s linear infinite lds-dual-ring;display:block}@keyframes lds-dual-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}</style><link as=fetch crossorigin href=/minesweeper6d/minesweeper6d-403ce4580ec37bba_bg.wasm integrity=sha384-4YTapbnCw3VzO8pQkcPtTzoeQdrNxNa-nse5Aqn_iEp2cRqsyIngoUbi1NaMY8JW rel=preload type=application/wasm><link crossorigin href=/minesweeper6d/minesweeper6d-403ce4580ec37bba.js integrity=sha384-RM1bQ1ParaUjGheYnQsCEH11STFyaj7U56HJBkAUynbnDMET8QZ2Fo7tOfPRkl96 rel=modulepreload></head><body><canvas id=the_canvas_id></canvas><script>if(`serviceWorker` in navigator&&window.location.hash!==`#dev`){window.addEventListener(`load`,(()=>{navigator.serviceWorker.register(`sw.js`)}))}</script></body></html>
28 changes: 28 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "egui Template PWA",
"short_name": "egui-template-pwa",
"icons": [
{
"src": "./icon-256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "./maskable_icon_x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "./icon-1024.png",
"sizes": "1024x1024",
"type": "image/png"
}
],
"lang": "en-US",
"id": "/index.html",
"start_url": "./index.html",
"display": "standalone",
"background_color": "white",
"theme_color": "white"
}
Binary file added maskable_icon_x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions minesweeper6d-403ce4580ec37bba.js

Large diffs are not rendered by default.

Binary file added minesweeper6d-403ce4580ec37bba_bg.wasm
Binary file not shown.
25 changes: 25 additions & 0 deletions sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var cacheName = 'egui-template-pwa';
var filesToCache = [
'./',
'./index.html',
'./eframe_template.js',
'./eframe_template_bg.wasm',
];

/* Start the service worker and cache all of the app's content */
self.addEventListener('install', function (e) {
e.waitUntil(
caches.open(cacheName).then(function (cache) {
return cache.addAll(filesToCache);
})
);
});

/* Serve cached content when offline */
self.addEventListener('fetch', function (e) {
e.respondWith(
caches.match(e.request).then(function (response) {
return response || fetch(e.request);
})
);
});

0 comments on commit 35c5fbf

Please sign in to comment.