-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
139 changed files
with
2,125 additions
and
1,736 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
NEXT_PUBLIC_REDUX_LOGGER=false | ||
NEXT_PUBLIC_SORA_SIGNALING_URL=ws://localhost:5000/signaling | ||
NEXT_PUBLIC_E2EE_WASM_URL=https://sora-e2ee-wasm.shiguredo.app/2020.2/wasm.wasm | ||
NEXT_PUBLIC_LIGHT_ADJUSTMENT_ASSETS_PATH=https://cdn.jsdelivr.net/npm/@shiguredo/light-adjustment@latest/dist | ||
NEXT_PUBLIC_VIRTUAL_BACKGROUND_ASSETS_PATH=https://cdn.jsdelivr.net/npm/@shiguredo/virtual-background@latest/dist | ||
NEXT_PUBLIC_NOISE_SUPPRESSION_ASSETS_PATH=https://cdn.jsdelivr.net/npm/@shiguredo/noise-suppression@latest/dist |
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
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
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,43 @@ | ||
name: Deploy sora-devtools to Pages | ||
|
||
on: | ||
push: | ||
branches: ["develop", "feature/github-pages"] | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22" | ||
- uses: pnpm/action-setup@v4 | ||
# - uses: actions/configure-pages@v5 | ||
# with: | ||
# static_site_generator: next | ||
- run: pnpm install | ||
- run: pnpm run build | ||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./dist | ||
|
||
deploy: | ||
needs: build | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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
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
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
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
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,139 @@ | ||
import argparse | ||
import re | ||
import subprocess | ||
from typing import Optional | ||
|
||
|
||
# ファイルを読み込み、バージョンを更新 | ||
def update_version(file_path: str, dry_run: bool) -> Optional[str]: | ||
with open(file_path, "r", encoding="utf-8") as f: | ||
content: str = f.read() | ||
|
||
# 現在のバージョンを取得 | ||
current_version_match = re.search(r'"version"\s*:\s*"([\d\.\w-]+)"', content) | ||
if not current_version_match: | ||
raise ValueError("Version not found or incorrect format in package.json") | ||
|
||
current_version: str = current_version_match.group(1) | ||
|
||
# バージョンが -canary.X を持っている場合の更新 | ||
if "-canary." in current_version: | ||
new_content, count = re.subn( | ||
r'("version"\s*:\s*")(\d+\.\d+\.\d+-canary\.)(\d+)', | ||
lambda m: f"{m.group(1)}{m.group(2)}{int(m.group(3)) + 1}", | ||
content, | ||
) | ||
else: | ||
# -canary.X がない場合、次のマイナーバージョンにして -canary.0 を追加 | ||
new_content, count = re.subn( | ||
r'("version"\s*:\s*")(\d+)\.(\d+)\.(\d+)', | ||
lambda m: f"{m.group(1)}{m.group(2)}.{int(m.group(3)) + 1}.0-canary.0", | ||
content, | ||
) | ||
|
||
if count == 0: | ||
raise ValueError("Version not found or incorrect format in package.json") | ||
|
||
# 新しいバージョンを確認 | ||
new_version_match = re.search(r'"version"\s*:\s*"([\d\.\w-]+)"', new_content) | ||
if not new_version_match: | ||
raise ValueError("Failed to extract the new version after the update.") | ||
|
||
new_version: str = new_version_match.group(1) | ||
|
||
print(f"Current version: {current_version}") | ||
print(f"New version: {new_version}") | ||
confirmation: str = ( | ||
input("Do you want to update the version? (Y/n): ").strip().lower() | ||
) | ||
|
||
if confirmation != "y": | ||
print("Version update canceled.") | ||
return None | ||
|
||
# Dry-run 時の動作 | ||
if dry_run: | ||
print("Dry-run: Version would be updated to:") | ||
print(new_content) | ||
else: | ||
with open(file_path, "w", encoding="utf-8") as f: | ||
f.write(new_content) | ||
print(f"Version updated in package.json to {new_version}") | ||
|
||
return new_version | ||
|
||
|
||
# pnpm install & pnpm build 実行 | ||
def run_pnpm_operations(dry_run: bool) -> None: | ||
if dry_run: | ||
print("Dry-run: Would run 'pnpm run dist'") | ||
else: | ||
subprocess.run(["pnpm", "run", "dist"], check=True) | ||
print("pnpm run dist executed") | ||
|
||
|
||
# git コミット、タグ、プッシュを実行 | ||
def git_commit_version(new_version: str, dry_run: bool) -> None: | ||
if dry_run: | ||
print("Dry-run: Would run 'git add package.json'") | ||
print(f"Dry-run: Would run '[canary] Bump version to {new_version}'") | ||
else: | ||
subprocess.run(["git", "add", "package.json"], check=True) | ||
subprocess.run( | ||
["git", "commit", "-m", f"[canary] Bump version to {new_version}"], | ||
check=True, | ||
) | ||
print(f"Version bumped and committed: {new_version}") | ||
|
||
|
||
# git コミット、タグ、プッシュを実行 | ||
def git_operations_after_build(new_version: str, dry_run: bool) -> None: | ||
if dry_run: | ||
print("Dry-run: Would run 'git add dist/'") | ||
print(f"Dry-run: Would run '[canary] Add dist files for {new_version}'") | ||
print(f"Dry-run: Would run 'git tag {new_version}'") | ||
print("Dry-run: Would run 'git push'") | ||
print(f"Dry-run: Would run 'git push origin {new_version}'") | ||
else: | ||
subprocess.run(["git", "add", "dist/"], check=True) | ||
subprocess.run( | ||
["git", "commit", "-m", f"[canary] Add dist files for {new_version}"], | ||
check=True, | ||
) | ||
subprocess.run(["git", "tag", new_version], check=True) | ||
subprocess.run(["git", "push"], check=True) | ||
subprocess.run(["git", "push", "origin", new_version], check=True) | ||
|
||
|
||
# メイン処理 | ||
def main() -> None: | ||
parser = argparse.ArgumentParser( | ||
description="Update package.json version, run pnpm install, build, and commit changes." | ||
) | ||
parser.add_argument( | ||
"--dry-run", | ||
action="store_true", | ||
help="Run in dry-run mode without making actual changes", | ||
) | ||
args = parser.parse_args() | ||
|
||
package_json_path: str = "package.json" | ||
|
||
# バージョン更新 | ||
new_version: Optional[str] = update_version(package_json_path, args.dry_run) | ||
|
||
if not new_version: | ||
return # ユーザーが確認をキャンセルした場合、処理を中断 | ||
|
||
# バージョン更新後にまず git commit | ||
git_commit_version(new_version, args.dry_run) | ||
|
||
# pnpm install & build 実行 | ||
run_pnpm_operations(args.dry_run) | ||
|
||
# ビルド後のファイルを git commit, タグ付け、プッシュ | ||
git_operations_after_build(new_version, args.dry_run) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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 |
---|---|---|
@@ -1 +1 @@ | ||
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link rel="preload" href="/_next/static/css/eb7d75aaf9aae9d7.css" as="style"/><link rel="stylesheet" href="/_next/static/css/eb7d75aaf9aae9d7.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-a432cf42cf045819.js" defer=""></script><script src="/_next/static/chunks/framework-4ed78fcefec7e84d.js" defer=""></script><script src="/_next/static/chunks/main-276b825106a04641.js" defer=""></script><script src="/_next/static/chunks/pages/_app-350942015c635c5c.js" defer=""></script><script src="/_next/static/chunks/pages/_error-0e8428b30c6c0304.js" defer=""></script><script src="/_next/static/sora_devtools/_buildManifest.js" defer=""></script><script src="/_next/static/sora_devtools/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"sora_devtools","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html> | ||
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">404: This page could not be found</title><link rel="preload" href="/_next/static/css/8e274babe325500e.css" as="style"/><link rel="stylesheet" href="/_next/static/css/8e274babe325500e.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-256290675aa7520d.js" defer=""></script><script src="/_next/static/chunks/framework-18714c6b85fd6b0c.js" defer=""></script><script src="/_next/static/chunks/main-95d54ce5e9d327f8.js" defer=""></script><script src="/_next/static/chunks/pages/_app-c66f1e45f07c050d.js" defer=""></script><script src="/_next/static/chunks/pages/_error-c62151a4dbbb9ed1.js" defer=""></script><script src="/_next/static/sora_devtools/_buildManifest.js" defer=""></script><script src="/_next/static/sora_devtools/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"sora_devtools","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html> |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.