Next (#1063)
|
|
@ -10,7 +10,7 @@ builds:
|
|||
env:
|
||||
- CGO_ENABLED=0
|
||||
binary: OliveTin
|
||||
main: main.go
|
||||
main: .
|
||||
dir: service
|
||||
goos:
|
||||
- linux
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
updatescreenshots:
|
||||
repo-common-take-screenshot mainpage-darkop http://localhost:1337/ 1024 680 --dark
|
||||
repo-common-take-screenshot mainpage-laptop http://localhost:1337/ 1024 680
|
||||
repo-common-take-screenshot mainpage-phone http://localhost:1337/ 600 1160
|
||||
SCREENSHOT_DIR=screenshots SHOT_WIDTH=1024 SHOT_HEIGHT=680 SHOT_DARK=1 repo-helper screenshot mainpage-darkop http://localhost:1337/ --width 1024 --height 680 --script resize_viewport.py
|
||||
SCREENSHOT_DIR=screenshots SHOT_WIDTH=1024 SHOT_HEIGHT=680 repo-helper screenshot mainpage-laptop http://localhost:1337/ --width 1024 --height 680 --script resize_viewport.py
|
||||
SCREENSHOT_DIR=screenshots SHOT_WIDTH=600 SHOT_HEIGHT=1160 repo-helper screenshot mainpage-phone http://localhost:1337/ --width 600 --height 1160 --script resize_viewport.py
|
||||
repo-common-image-framer
|
||||
|
||||
.PHONY: updatescreenshots
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
import os
|
||||
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
|
||||
from repo_helper.screenshot import set_viewport_size
|
||||
|
||||
|
||||
def _enable_dark_mode(driver):
|
||||
driver.execute_cdp_cmd(
|
||||
"Emulation.setEmulatedMedia",
|
||||
{"features": [{"name": "prefers-color-scheme", "value": "dark"}]},
|
||||
)
|
||||
|
||||
|
||||
def run(driver):
|
||||
WebDriverWait(driver, 30).until(
|
||||
lambda d: bool(d.find_element(By.TAG_NAME, "body").get_attribute("loaded-dashboard"))
|
||||
)
|
||||
if os.environ.get("SHOT_DARK") == "1":
|
||||
_enable_dark_mode(driver)
|
||||
width = int(os.environ["SHOT_WIDTH"])
|
||||
height = int(os.environ["SHOT_HEIGHT"])
|
||||
set_viewport_size(driver, width, height)
|
||||
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 167 KiB |
|
|
@ -17,7 +17,7 @@
|
|||
<MajorUpgrade
|
||||
AllowSameVersionUpgrades="yes"
|
||||
DowngradeErrorMessage="A newer version of OliveTin is already installed." />
|
||||
<MediaTemplate />
|
||||
<MediaTemplate EmbedCab="yes" />
|
||||
|
||||
<Feature Id="ProductFeature" Title="OliveTin" Level="1">
|
||||
<ComponentGroupRef Id="CG.AppFiles" />
|
||||
|
|
|
|||
|
|
@ -63,6 +63,15 @@ if [[ ! -f "${SOURCE_ROOT}/config.yaml" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v objdump >/dev/null; then
|
||||
echo "objdump is required to verify OliveTin.exe Windows resources" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! objdump -h "${SOURCE_ROOT}/OliveTin.exe" | grep -q '[[:space:]]\.rsrc[[:space:]]'; then
|
||||
echo "OliveTin.exe is missing embedded Windows resources (.rsrc); use main: . in .goreleaser.yml" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "${APP_STAGING}/webui"
|
||||
cp "${SOURCE_ROOT}/OliveTin.exe" "${APP_STAGING}/"
|
||||
cp -a "${SOURCE_ROOT}/webui/." "${APP_STAGING}/webui/"
|
||||
|
|
@ -89,4 +98,9 @@ wixl \
|
|||
"${SCRIPT_DIR}/OliveTin.wxs" \
|
||||
"${HEAT_WXS}"
|
||||
|
||||
if ! msiinfo export "${MSI_PATH}" Media 2>/dev/null | grep -q '#cab1.cab'; then
|
||||
echo "MSI cabinet is not embedded (expected #cab1.cab in Media table); check EmbedCab in OliveTin.wxs" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Built ${MSI_PATH}"
|
||||
|
|
|
|||
|
|
@ -91,4 +91,10 @@ trap 'rm -rf "${WORK_DIR}" "${TOOL_BIN%/*}"' EXIT
|
|||
|
||||
rm -f "${SERVICE_DIR}"/resource_windows_*.syso
|
||||
mv "${WORK_DIR}"/resource_windows_*.syso "${SERVICE_DIR}/"
|
||||
|
||||
if ! compgen -G "${SERVICE_DIR}/resource_windows_*.syso" >/dev/null; then
|
||||
echo "goversioninfo did not produce resource_windows_*.syso files" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Wrote Windows resource files to ${SERVICE_DIR}"
|
||||
|
|
|
|||