2023-12-28 23:00:41 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-01-18 00:38:01 +00:00
|
|
|
# sudo apt install -y jq zip
|
|
|
|
|
2023-12-28 23:00:41 +00:00
|
|
|
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
|
|
|
|
2024-01-18 00:38:01 +00:00
|
|
|
WRY_VER="0.1.1"
|
|
|
|
|
|
|
|
mkdir -p win64/{deps,dist}
|
2023-12-28 23:00:41 +00:00
|
|
|
dl_file() {
|
|
|
|
local FILE="$1"
|
2024-01-18 00:38:01 +00:00
|
|
|
if [[ ! -f "win64/deps/$FILE" ]]; then
|
|
|
|
curl -fsL "https://um-react.app/files/${FILE}.gz" | gzip -d >"win64/deps/${FILE}"
|
2023-12-28 23:00:41 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-01-18 00:38:01 +00:00
|
|
|
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
|
2023-12-28 23:00:41 +00:00
|
|
|
|
|
|
|
APP_VERSION="$(jq -r '.version' <package.json)"
|
2023-12-28 23:09:56 +00:00
|
|
|
EXE_NAME="um-react-win64-${APP_VERSION}.exe"
|
|
|
|
ZIP_NAME="um-react-win64-${APP_VERSION}.zip"
|
2024-01-18 00:38:01 +00:00
|
|
|
"./win64/deps/um-react-wry-builder-${WRY_VER}-linux-amd64" \
|
|
|
|
-t "win64/deps/um-react-wry-stub-${WRY_VER}-win64.exe" \
|
2023-12-28 23:00:41 +00:00
|
|
|
-r um-react.zip \
|
2024-01-18 00:38:01 +00:00
|
|
|
-o "win64/dist/${EXE_NAME}"
|
2023-12-28 23:00:41 +00:00
|
|
|
|
2024-01-18 00:38:01 +00:00
|
|
|
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}'."
|
2023-12-28 23:00:41 +00:00
|
|
|
|
|
|
|
popd
|