diff --git a/.github/workflows/tauri_app_build.yml b/.github/workflows/tauri_app_build.yml index 806d9169..3d091e64 100644 --- a/.github/workflows/tauri_app_build.yml +++ b/.github/workflows/tauri_app_build.yml @@ -43,6 +43,8 @@ jobs: script-name: app.py output-file: iib_api_server output-dir: out + include-data-dir: | + vue/dist=vue/dist - name: Upload Server Artifacts uses: actions/upload-artifact@v3 @@ -196,6 +198,16 @@ jobs: name: bundle-${{ env.VERSION }}-Linux path: artifacts + - uses: actions/download-artifact@v3 + with: + name: iib_api_server-${{ env.VERSION }}-Windows + path: artifacts + + - uses: actions/download-artifact@v3 + with: + name: iib_api_server-${{ env.VERSION }}-Linux + path: artifacts + - name: Release uses: softprops/action-gh-release@v1 with: diff --git a/scripts/iib/api.py b/scripts/iib/api.py index e909ae4f..1760f29b 100644 --- a/scripts/iib/api.py +++ b/scripts/iib/api.py @@ -73,7 +73,7 @@ except Exception as e: logger.error(e) -index_html_path = os.path.join(cwd, "vue/dist/index.html") # 在app.py也被使用 +index_html_path = os.path.normpath(os.path.join(__file__, "../","vue/dist/index.html")) if is_exe_ver else os.path.join(cwd, "vue/dist/index.html") # 在app.py也被使用 send_img_path = {"value": ""} @@ -746,7 +746,7 @@ def index_bd(): return Response(content=content, media_type="text/html") return FileResponse(index_html_path) - static_dir = f"{cwd}/vue/dist" + static_dir = os.path.normpath(os.path.join(__file__, "../","vue/dist")) if is_exe_ver else f"{cwd}/vue/dist" @app.get(api_base + "/fe-static/{file_path:path}") async def serve_static_file(file_path: str): file_full_path = f"{static_dir}/{file_path}"