mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2024-11-23 18:52:16 +00:00
docs: add note about win64 build
This commit is contained in:
parent
602d6865f5
commit
0a3dac9d3d
3
.gitignore
vendored
3
.gitignore
vendored
@ -27,3 +27,6 @@ dist-ssr
|
||||
# Files created when running "drone exec" locally
|
||||
/.pnpm-store/
|
||||
/*.zip
|
||||
|
||||
/um-react-wry-*
|
||||
/um-react*.exe
|
||||
|
@ -33,3 +33,29 @@ pnpm build
|
||||
如果需要预览构建版本,运行 `pnpm preview` 然后打开[项目预览页面][vite-preview-url]即可。
|
||||
|
||||
[vite-preview-url]: http://localhost:4173/
|
||||
|
||||
## 打包 `.zip`
|
||||
|
||||
建议在 Linux 环境下执行,可参考 `.drone.yml` CI 文件。
|
||||
|
||||
1. 确保上述的构建步骤已完成。
|
||||
2. 确保 `python3` 已安装。
|
||||
3. 执行下述代码
|
||||
```sh
|
||||
python3 -m zipfile -c um-react.zip dist/.
|
||||
```
|
||||
|
||||
## 打包 win64 单文件
|
||||
|
||||
利用 Windows 系统自带的 [WebView2 组件(Edge 浏览器运行时)](https://learn.microsoft.com/zh-cn/microsoft-edge/webview2/)
|
||||
和 [wry](https://github.com/tauri-apps/wry) 进行一个单文件的打包。
|
||||
|
||||
其它系统兼容性未知。
|
||||
|
||||
1. 确保你现在在 `linux-amd64` 环境下。
|
||||
2. 确保上述的 `um-react.zip` 构建已完成。
|
||||
3. 执行下述代码
|
||||
```sh
|
||||
./scripts/make-win64.sh
|
||||
```
|
||||
4. 等待提示 `done!` 即可。
|
||||
|
24
scripts/make-win64.sh
Executable file
24
scripts/make-win64.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
||||
|
||||
dl_file() {
|
||||
local FILE="$1"
|
||||
if [[ ! -f "$FILE" ]]; then
|
||||
curl -fsL "https://um-react.app/files/${FILE}.gz" | gzip -d >"${FILE}"
|
||||
fi
|
||||
}
|
||||
|
||||
dl_file "um-react-wry-builder-0.1.0-linux-amd64"
|
||||
dl_file "um-react-wry-stub-0.1.0-win64.exe"
|
||||
chmod a+x um-react-wry-builder-0.1.0-linux-amd64
|
||||
|
||||
APP_VERSION="$(jq -r '.version' <package.json)"
|
||||
./um-react-wry-builder-0.1.0-linux-amd64 \
|
||||
-t um-react-wry-stub-0.1.0-win64.exe \
|
||||
-r um-react.zip \
|
||||
-o "um-react-win64-${APP_VERSION}.exe"
|
||||
|
||||
echo "Built 'um-react-win64-${APP_VERSION}.exe'."
|
||||
|
||||
popd
|
Loading…
Reference in New Issue
Block a user