-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
725c35d
commit be9ff29
Showing
2 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,12 +60,8 @@ jobs: | |
name: Build project (Makefile) | ||
run: make | ||
- | ||
name: Build page (Makefile) | ||
run: >- | ||
mkdir -p html && | ||
curl -o html/nes.js "https://cdn.jsdelivr.net/gh/takahirox/[email protected]/build/nes.min.js" && | ||
sh -c 'awk "{gsub(/{{game}}/, \"Kokobatoru 2\");} /{{rom}}/ {cmd=\"base64 bin/kokobatoru.nes\"; while ((cmd | getline line) > 0) var = var line; close(cmd); gsub(/{{rom}}/, var);} 1" res/index.html' > html/jap.html && | ||
sh -c 'awk "{gsub(/{{game}}/, \"Coco Battle Royale II\");} /{{rom}}/ {cmd=\"base64 bin/cocobattleroyale.nes\"; while ((cmd | getline line) > 0) var = var line; close(cmd); gsub(/{{rom}}/, var);} 1" res/index.html' > html/usa.html | ||
name: Build page (Python) | ||
run: ./build-pwa.py && ./build-pwa.py --jap | ||
- | ||
name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
from base64 import b64encode as b64 | ||
import sys | ||
|
||
title = 'Coco Battle Royale II' | ||
input = './bin/cocobattleroyale.nes' | ||
output = './html/usa.html' | ||
|
||
if '--jap' in sys.argv: | ||
title = 'Kokobatoru 2' | ||
input = './bin/kokobatoru.nes' | ||
output = './html/jap.html' | ||
|
||
rom = b64(open(input, "rb").read()).decode() | ||
html = open("./res/index.html", "r").read() | ||
html = html.replace(r'{{game}}', title).replace(r'{{rom}}', rom) | ||
|
||
open(output, "w").write(html) | ||
print(title) |