Skip to content

Commit

Permalink
ref npm run build
Browse files Browse the repository at this point in the history
  • Loading branch information
zy7y committed Apr 27, 2024
1 parent 6eb987f commit 5a90dba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
from PyInstaller import __main__ as pyi


def build_web():
subprocess.call(["npm", "i"], cwd="web")
subprocess.call(["npm", "run", "build"], cwd="web")


def gen_client_py():
code = """
import random
Expand Down Expand Up @@ -45,9 +50,9 @@ def desktop_client():
f.write(code)


build_web()
gen_client_py()


params = [
"--windowed",
"--onefile",
Expand All @@ -63,7 +68,6 @@ def desktop_client():

pyi.run(params)


# 如果是macos,则压缩打包后的目录
if platform.system() == "Darwin":
cmds = ["zip", "-r", "dist/client.zip", "dist/"]
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/build_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,19 @@ jobs:
matrix:
os: [ windows-latest, macos-latest ]
steps:
- name: Checkout代码
- name: 拉代码
uses: actions/checkout@v3
- name: 设置Node.js环境

- name: Node 18.15
uses: actions/setup-node@v3
with:
node-version: 18.15
- name: 进入web目录
run: cd web
- name: 安装依赖
run: npm i
- name: 打包Node.js应用
run: npm run build
- uses: actions/checkout@v3
- name: Set up Python 3.11
node-version: "18.15"

- name: Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"

- name: Install dependencies
run: |
pip install -r requirements-build.txt
Expand Down

0 comments on commit 5a90dba

Please sign in to comment.