chore: make win64 build to its own dir

This commit is contained in:
鲁树人 2024-01-18 00:38:01 +00:00
parent 741e302ea7
commit 1ae2f93e99
2 changed files with 18 additions and 11 deletions

2
.gitignore vendored
View File

@ -30,3 +30,5 @@ dist-ssr
/um-react-wry-*
/um-react*.exe
/win64/

View File

@ -1,28 +1,33 @@
#!/bin/bash
# sudo apt install -y jq zip
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
WRY_VER="0.1.1"
mkdir -p win64/{deps,dist}
dl_file() {
local FILE="$1"
if [[ ! -f "$FILE" ]]; then
curl -fsL "https://um-react.app/files/${FILE}.gz" | gzip -d >"${FILE}"
if [[ ! -f "win64/deps/$FILE" ]]; then
curl -fsL "https://um-react.app/files/${FILE}.gz" | gzip -d >"win64/deps/${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
dl_file "um-react-wry-builder-${WRY_VER}-linux-amd64"
dl_file "um-react-wry-stub-${WRY_VER}-win64.exe"
chmod a+x win64/deps/um-react-wry-builder-${WRY_VER}-linux-amd64
APP_VERSION="$(jq -r '.version' <package.json)"
EXE_NAME="um-react-win64-${APP_VERSION}.exe"
ZIP_NAME="um-react-win64-${APP_VERSION}.zip"
./um-react-wry-builder-0.1.0-linux-amd64 \
-t um-react-wry-stub-0.1.0-win64.exe \
"./win64/deps/um-react-wry-builder-${WRY_VER}-linux-amd64" \
-t "win64/deps/um-react-wry-stub-${WRY_VER}-win64.exe" \
-r um-react.zip \
-o "${EXE_NAME}"
-o "win64/dist/${EXE_NAME}"
touch -d 1970-01-01T00:00:00Z "${EXE_NAME}"
zip -9oX "${ZIP_NAME}" -- "${EXE_NAME}"
echo "[Build OK] '${ZIP_NAME}'."
touch -d 1970-01-01T00:00:00Z "win64/dist/${EXE_NAME}"
zip -9oX "win64/dist/${ZIP_NAME}" -- "win64/dist/${EXE_NAME}"
echo "[Build OK] 'win64/dist/${ZIP_NAME}'."
popd