Compare commits

...

85 Commits

Author SHA1 Message Date
e5e8234fef
cleanup 2024-04-21 01:36:12 +08:00
78227bba31
看不懂,告辞(不是 2024-04-21 01:29:56 +08:00
5195bac03a
yea? 2024-04-20 22:55:48 +08:00
cf0a30d7e6
naa 2024-04-20 22:53:58 +08:00
f822b0ca27
加一点信息 2024-04-20 22:53:42 +08:00
9459a6ebaa
再妥协一下 2024-04-20 22:51:06 +08:00
45e43f3629
fine…… 2024-04-20 22:46:53 +08:00
f04ea68d3b
部署! 2024-04-20 22:43:46 +08:00
dfc4f1f2d5
欸? 2024-04-20 22:37:30 +08:00
4f94d26c23
ruaaa 2024-04-20 22:31:39 +08:00
45d13a27d2
Create static.yml 2024-04-20 22:26:40 +08:00
cb2273be12
稍微妥协一下得了 2024-04-20 22:24:20 +08:00
633844d7ac
不需要你啦,GitHub Actions 2024-04-20 22:17:16 +08:00
bc362d0809
yea? 2024-04-20 22:15:39 +08:00
39e9d32c4d
gogogo 2024-04-20 22:13:52 +08:00
2c3a079dff
2024-04-20 21:54:53 +08:00
7642d78c7d
进行一个部署脚本的编写 2024-04-20 21:51:11 +08:00
d26b58f7d8
似乎进行一个fix? 2024-04-20 21:00:36 +08:00
7d2c85da3d
rua 2024-04-20 20:42:35 +08:00
ccfa58e435
T.b7 -> T.Grp 2024-04-20 20:39:56 +08:00
4400e2c28f
T.create_player -> T.choose_boss 2024-04-20 20:39:30 +08:00
b3eaeeab1e
一些研究 2024-04-20 20:31:41 +08:00
12749868da
H.uk -> H._installSpecializedAsCheck 2024-04-20 16:36:25 +08:00
943987020d
H.aH -> H._rtiToString 2024-04-20 16:33:30 +08:00
a63d57cb9f
H.ob -> H._Error_compose 2024-04-20 16:33:17 +08:00
0f47df33dd
H.oo -> H._failedAsCheck 2024-04-20 16:32:37 +08:00
68a4f791c5
H.ui -> H._generalNullableAsCheckImplementation 2024-04-20 16:32:15 +08:00
b6c7757c1f
优先修复一个傻逼问题 2024-04-20 16:19:46 +08:00
2faee3115c
P.kZ -> P._RootZone_bindCallback_closure 2024-04-20 16:16:57 +08:00
b0c39b8c74
P.cN -> P._FutureListener 2024-04-20 16:08:37 +08:00
ddb1274d52
P.ot -> P._rootRun 2024-04-20 16:07:24 +08:00
f16f67d33a
P.uA -> P._rootRunUnary 2024-04-20 16:06:33 +08:00
7d635e6d04
P.kX -> P._RootZone 2024-04-20 16:05:44 +08:00
1ac326504c
what 2024-04-20 16:02:29 +08:00
3737ba2264
顺便把后面这里的也替换掉 2024-04-20 15:59:34 +08:00
d5655eab6c
P.ca -> P._newHashTable 2024-04-20 15:57:58 +08:00
62dff4d569
P.a0 -> P.create_meta_map P.dD -> P.create_StringInt_map 2024-04-20 15:55:04 +08:00
ead50b9d53
W.cq -> W.File 2024-04-20 15:38:40 +08:00
1ca7919388
fix T.DummyRunUpdates in static 2024-04-20 15:34:53 +08:00
9c8d4c4091
fix static _startMicrotaskLoop 2024-04-20 15:27:41 +08:00
4829294cf2
P.zZ -> P.StreamIterator_StreamIterator 2024-04-20 15:24:49 +08:00
901115db22
P.oN -> P>scheduleMicrotask 2024-04-20 15:24:35 +08:00
a5b49557e9
P.uC -> P._schedulePriorityAsyncCallback 2024-04-20 15:24:18 +08:00
8ebf75e828
P.ou -> P._scheduleAsyncCallback 2024-04-20 15:24:06 +08:00
f941f6c253
P.uD -> P._startMicrotaskLoop 2024-04-20 15:23:47 +08:00
748f89c292
P.uw -> P._microtaskLoop 2024-04-20 15:23:31 +08:00
27a090b761
P.uz -> P._registerErrorHandler 2024-04-20 15:23:15 +08:00
9949a9a4a0
P.mk -> P._Future__chainCoreFuture 2024-04-20 15:22:50 +08:00
07daf8610e
P.iC -> P>_rootHandleUncaughtError 2024-04-20 15:20:15 +08:00
a67457f16a
P.c0 -> P._Future__propagateToListeners 2024-04-20 15:19:55 +08:00
ca0c26c01c
P.kR -> P._Future__propagateToListeners_handleWhenCompleteCallback 2024-04-20 15:19:30 +08:00
efc3b6acfb
P.async_return -> P._asyncReturn 2024-04-20 15:15:25 +08:00
162caf6f17
P.Timer_impl -> P.Timerimpl 2024-04-20 15:14:58 +08:00
3ac587b2eb
T.l8 -> T._TimerImpl 2024-04-20 15:14:21 +08:00
f9db7fde67
P.kA -> P._AsyncRun__initializeScheduleImmediate_closure 2024-04-20 15:12:18 +08:00
47571e35c0
P.kP -> P._Future__propagateToListeners_handleError 2024-04-20 15:09:18 +08:00
9824aa1f2f
P.kS -> P._Future__propagateToListeners_handleWhenCompleteCallback_closure 2024-04-20 15:09:05 +08:00
d50eea4292
P.kQ -> P._Future__propagateToListeners_handleValueCallback 2024-04-20 15:08:30 +08:00
735b6db67e
研究一下 benchmark 2024-04-20 14:53:33 +08:00
41c3efe023
Revert "T.h8 -> T.SklAttack"
This reverts commit 0cd5fe2b3d.

# Conflicts:
#	branch/latest/md5.js
2024-04-19 00:27:55 +08:00
b5ac69eff0
T.nX -> T.DummyRunUpdates 2024-04-19 00:20:45 +08:00
a2c223484c
T.rT -> T.DummyRunUpdates 2024-04-19 00:19:53 +08:00
bf4033618c
T.aX -> T.RunUpdate 2024-04-19 00:18:01 +08:00
1e80479530
T.RunUpdate -> T.RunUpdate_init 2024-04-19 00:17:51 +08:00
6e95ed0adb
T.h2 -> T.RunUpdateCancel 2024-04-19 00:17:32 +08:00
de2925c61e
T.RunUpdateCancel -> T.RunUpdateCancel_init 2024-04-19 00:17:17 +08:00
b16f0dd393
T.dX -> T.RunUpdateWin 2024-04-19 00:15:28 +08:00
f2fc5233d3
T.e0 -> T.ShieldStat 2024-04-19 00:12:25 +08:00
829e8c15e0
T.ik -> T.ShieldStat 2024-04-19 00:10:28 +08:00
c8d2160f29
T.ah -> T.PostDamageEntry 2024-04-19 00:06:56 +08:00
bd80287940
this! 2024-04-19 00:04:57 +08:00
14a25539b9
T.cA -> T.PostDamageImpl 2024-04-18 23:42:24 +08:00
ce61c7fb5e
T.bq -> T.PostActionEntry 2024-04-18 23:40:04 +08:00
830b9949db
T.aM -> T.Minion 2024-04-18 23:39:38 +08:00
edddabd79d
T.dB -> T.LazyState 2024-04-18 23:36:02 +08:00
40cce66619
T.hD -> T.SklSimpleAttack 2024-04-18 23:35:02 +08:00
0cd5fe2b3d
T.h8 -> T.SklAttack 2024-04-18 23:34:44 +08:00
f4f0425fd4
T.dd -> T.BerserkState 2024-04-18 23:31:15 +08:00
a1b9a989e6
T.fX -> T.PlrZombie 2024-04-18 23:28:06 +08:00
ac8b9dcf90
T.fD -> T.getMinionName 2024-04-18 23:27:08 +08:00
1bc318528c
T.dI -> T.MinionCount 2024-04-18 23:26:30 +08:00
241a432677
T.x -> T.IMeta 2024-04-18 23:25:45 +08:00
d09d89bb57
T.hY -> T.ZombieState 2024-04-18 23:25:05 +08:00
7484b7abbc
T.fC ->T.MergeState 2024-04-18 23:24:39 +08:00
ee73fa621f
T.dj -> T.CharmState 2024-04-18 23:22:18 +08:00
6 changed files with 1021 additions and 817 deletions

48
.github/workflows/static.yml vendored Normal file
View File

@ -0,0 +1,48 @@
# Simple workflow for deploying static content to GitHub Pages
name: GitHub pages 部署
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: 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: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 运行部署脚本
run: python3 deploy.py
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@ -560,13 +560,23 @@
0%, 0%,
80%, 80%,
100% { 100% {
transform: scale(0); transform: scale(0)
} }
40% { 40% {
transform: scale(1); transform: scale(1)
} }
} }
#version-marker {
background-color: white;
position: absolute;
top: 20px;
left: 20px;
border-radius: 5px;
/* border: 2px solid marker_color */
padding: 10px;
}
</style> </style>
<style id="pstyle"> <style id="pstyle">
</style> </style>
@ -618,6 +628,8 @@
<body> <body>
<div id="done_target" class="done_target" style="display: none;"></div> <div id="done_target" class="done_target" style="display: none;"></div>
<!-- 用于标记是否完事 默认隐藏--> <!-- 用于标记是否完事 默认隐藏-->
<div id="version-marker" style="display: none;"></div>
<!-- 左上角一个用于标记版本号的 div, 默认状况下不显示, 部署时使用脚本替换内容, 颜色同理 -->
<img src="thumb.jpg" width="0" height="0" /> <img src="thumb.jpg" width="0" height="0" />
<div class='ad_h'></div> <div class='ad_h'></div>
<div class='ad_v'></div> <div class='ad_v'></div>

View File

@ -567,6 +567,16 @@
transform: scale(1); transform: scale(1);
} }
} }
#version-marker {
background-color: white;
position: absolute;
top: 20px;
left: 20px;
border-radius: 5px;
/* border: 2px solid marker_color */
padding: 10px;
}
</style> </style>
<style id="pstyle"> <style id="pstyle">
</style> </style>
@ -618,6 +628,8 @@
<body> <body>
<div id="done_target" class="done_target" style="display: none;"></div> <div id="done_target" class="done_target" style="display: none;"></div>
<!-- 用于标记是否完事 默认隐藏--> <!-- 用于标记是否完事 默认隐藏-->
<div id="version-marker" style="display: none;"></div>
<!-- 左上角一个用于标记版本号的 div, 默认状况下不显示, 部署时使用脚本替换内容, 颜色同理 -->
<img src="thumb.jpg" width="0" height="0" /> <img src="thumb.jpg" width="0" height="0" />
<div class='ad_h'></div> <div class='ad_h'></div>
<div class='ad_v'></div> <div class='ad_v'></div>

File diff suppressed because it is too large Load Diff

124
deploy.py Normal file
View File

@ -0,0 +1,124 @@
import os
import random
from subprocess import run
from pathlib import Path
ON_CF = os.getenv("CF_PAGES") == "1"
if ON_CF:
print("Running on Cloudflare Pages, trying to git fetch --all")
result = run(["git", "fetch", "--all"], check=False)
print(f"git fetch --all: {result}")
# 提前尝试输出一遍下面这堆信息
run(["git", "branch", "--show-current"], check=False)
run(["git", "rev-parse", "HEAD"], check=False)
run(["git", "describe", "--tags"], check=False)
run(["git", "log", "-1", "--pretty=%B"], check=False)
def get_env_info() -> dict[str, str]:
# 读取环境变量
env_info = {}
# git branch
if ON_CF:
branch = os.getenv("CF_PAGES_BRANCH") or "unknown"
else:
branch = run(
["git", "branch", "--show-current"],
capture_output=True,
text=True,
encoding="utf-8",
).stdout
env_info["branch"] = branch.strip()
# git commit hash
if ON_CF:
commit = os.getenv("CF_PAGES_COMMIT_SHA") or "unknown"
else:
commit = run(
["git", "rev-parse", "HEAD"],
capture_output=True,
text=True,
encoding="utf-8",
).stdout
env_info["commit"] = commit.strip()
# git commit message
message = run(
["git", "log", "-1", "--pretty=%B"],
capture_output=True,
text=True,
encoding="utf-8",
)
env_info["message"] = message.stdout.strip()
# git tag
if ON_CF:
tag = run(
["git", "describe", "--tags"], capture_output=True, text=True, encoding="utf-8"
).stdout.split("-")[0] or "cf_pages"
else:
tag = run(
["git", "describe", "--tags"], capture_output=True, text=True, encoding="utf-8"
).stdout.split("-")[0]
env_info["tag"] = tag.strip()
return env_info
if __name__ == "__main__":
# 虽然但是, 我还是决定用 python 写这个脚本
border_raw = "/* border: 2px solid marker_color */"
border_template = "border: 2px solid {};"
marker_raw = '<div id="version-marker" style="display: none;"></div>'
marker_template = '<div id="version-marker">{}</div>'
# 读取环境变量
env_info = get_env_info()
tag = env_info["tag"]
branch = env_info["branch"]
commit = env_info["commit"]
message = env_info["message"]
for file in Path.cwd().rglob("index.html"):
try:
with open(file, "r", encoding="utf-8") as f:
raw_content = f.read()
except Exception as e:
print(f"Error: {e}")
continue
print(f"Reading: {file}")
# 替换内容
# 首先判断是否是 /branch 目录下的 index.html
if "branch" in str(file):
# 如果是, 则将颜色替换为 random(这里是为了区分不同的分支, 并且颜色相对固定)
file_branch_name = file.parent.name
randomer = random.Random(file_branch_name)
hash_color = randomer.randint(0, 0xFFFFFF)
border = border_template.format(f"#{hash_color:06x}")
# git 信息:
version_info = f"{file_branch_name}/{branch}:{tag}-{commit[:6]}<br/>{message}"
marker = marker_template.format(version_info)
print(f"Branch: {file_branch_name}\n{border}\n{marker}\n")
else:
# 淡绿色!
border = border_template.format("greenyellow")
# git 信息:
version_info = f"{branch}:{tag}-{commit[:6]}"
marker = marker_template.format(version_info)
print(f"Master: {border}\n{marker}\n")
raw_content = raw_content.replace(border_raw, border).replace(
marker_raw, marker
)
# 写入文件
try:
with open(file, "w", encoding="utf-8") as f:
f.write(raw_content)
except Exception as e:
print(f"Error writing file: {e}")
continue

View File

@ -569,6 +569,16 @@
transform: scale(1); transform: scale(1);
} }
} }
#version-marker {
background-color: white;
position: absolute;
top: 20px;
left: 20px;
border-radius: 5px;
/* border: 2px solid marker_color */
padding: 10px;
}
</style> </style>
<style id="pstyle"> <style id="pstyle">
</style> </style>
@ -620,6 +630,8 @@
<body> <body>
<div id="done_target" class="done_target" style="display: none;"></div> <div id="done_target" class="done_target" style="display: none;"></div>
<!-- 用于标记是否完事 默认隐藏--> <!-- 用于标记是否完事 默认隐藏-->
<div id="version-marker" style="display: none;"></div>
<!-- 左上角一个用于标记版本号的 div, 默认状况下不显示, 部署时使用脚本替换内容, 颜色同理 -->
<img src="thumb.jpg" width="0" height="0" /> <img src="thumb.jpg" width="0" height="0" />
<div class='ad_h'></div> <div class='ad_h'></div>
<div class='ad_v'></div> <div class='ad_v'></div>