Windows kernel no longer hangs on a second start; CI for three platforms
Lightproof, the Python grammar checker in the English dictionaries, hung the Windows worker whenever a profile was reused; macOS and Linux carry no Python, so it never ran there. The build now drops it. A killed worker's profile and document locks hung the next start or load: the worker runs with SAL_NOLOCK_PROFILE and ely.xcd turns off LibreOffice's locking; Ely checks conflicts itself. release.yml runs scripts/ci.sh for each platform on tag push: the Mac mini builds its engines once in a lasting clone, the Windows runner links this machine's engines, and Linux builds in WSL on that runner. makensis reads the script as UTF-8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
126175e589
commit
e48035cdd5
8 files changed
+151
-19
No files matched your search
@@ -132,6 +132,20 @@ for dict in "$extensions"/dict-*; do
|
||||
fi
|
||||
done
|
||||
echo "build-libreoffice.sh: dictionaries kept: $(ls "$extensions" | tr '\n' ' ')"
|
||||
# Lightproof is Python: inert without it, a hang on Windows.
|
||||
en=$extensions/dict-en
|
||||
rm -rf "$en/Lightproof.py" "$en/Lightproof.components" "$en/Linguistic.xcu" "$en/pythonpath" "$en/dialog"
|
||||
python3 - "$en/META-INF/manifest.xml" <<'PY'
|
||||
import re, sys
|
||||
path = sys.argv[1]
|
||||
text = open(path, encoding="utf-8").read()
|
||||
gone = r'\s*<manifest:file-entry[^>]*?"(?:Lightproof\.components|Linguistic\.xcu|dialog/[^"]*)"[^>]*/>'
|
||||
kept = re.sub(gone, "", text, flags=re.S)
|
||||
for left in ("Lightproof", "Linguistic.xcu", "dialog/"):
|
||||
if left in kept:
|
||||
sys.exit(f"build-libreoffice.sh: {left} is still in {path}")
|
||||
open(path, "w", encoding="utf-8").write(kept)
|
||||
PY
|
||||
# Ely's kernel defaults: Excel A1 formulas.
|
||||
cp "$root/packaging/libreoffice/ely.xcd" "$app/registry/"
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
# A platform's release. Usage: ci.sh <macos|windows|linux> <tag>
|
||||
set -euo pipefail
|
||||
|
||||
root=$(cd "$(dirname "$0")/.." && pwd)
|
||||
os=${1:?macos, windows or linux}
|
||||
tag=${2:?the release tag, such as v0.1.3}
|
||||
version=$(awk -F'"' '/^version = / { print $2; exit }' "$root/Cargo.toml")
|
||||
[ "$tag" = "v$version" ] || {
|
||||
echo "ci.sh: tag $tag is not v$version" >&2
|
||||
exit 1
|
||||
}
|
||||
: "${ELY_RELEASE_TOKEN:?the Gitea token that uploads}"
|
||||
[ -z "${ELY_PATH:-}" ] || PATH=$ELY_PATH:$PATH
|
||||
cd "$root"
|
||||
|
||||
# Engines another clone on this host built; else built here.
|
||||
if [ -n "${ELY_SHARE:-}" ]; then
|
||||
for part in engines reference; do
|
||||
if [ ! -e "$part" ]; then
|
||||
case $os in
|
||||
windows) cmd //c mklink /J "$part" "$(cygpath -w "$ELY_SHARE/$part")" ;;
|
||||
*) ln -s "$ELY_SHARE/$part" "$part" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
else
|
||||
scripts/fetch-references.sh
|
||||
scripts/build-mupdf.sh
|
||||
scripts/fetch-cef.sh
|
||||
scripts/build-git.sh
|
||||
scripts/fetch-git-lfs.sh
|
||||
scripts/fetch-tessdata.sh
|
||||
scripts/build-mark-content.sh
|
||||
scripts/build-libreoffice.sh
|
||||
fi
|
||||
|
||||
dist=$root/dist
|
||||
rm -rf "$dist"
|
||||
batch=$(awk -F'\t' '$4 == 1 { print $1 }' packaging/apps.tsv)
|
||||
case $os in
|
||||
macos) packaging/macos/release.sh 1 ;;
|
||||
windows) for slug in $batch; do packaging/windows/installer.sh "$slug"; done ;;
|
||||
linux) for slug in $batch; do packaging/linux/appimage.sh "$slug"; done ;;
|
||||
*)
|
||||
echo "ci.sh: no release for $os" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# The tag's release, made by whichever platform comes first.
|
||||
api=https://git.zacharyzhang.com/api/v1/repos/ZacharyZhang-NY/ElyOffice
|
||||
auth="Authorization: token $ELY_RELEASE_TOKEN"
|
||||
release_id() { curl -fsS -H "$auth" "$api/releases/tags/$tag" | python3 -c 'import json, sys; print(json.load(sys.stdin)["id"])'; }
|
||||
if ! id=$(release_id 2>/dev/null); then
|
||||
body="{\"tag_name\": \"$tag\", \"name\": \"Ely Office $version\"}"
|
||||
# Another platform may make it first; the read decides.
|
||||
curl -fsS -H "$auth" -H "Content-Type: application/json" -d "$body" "$api/releases" >/dev/null || true
|
||||
id=$(release_id)
|
||||
fi
|
||||
for file in "$dist"/*; do
|
||||
[ -f "$file" ] || continue
|
||||
name=$(basename "$file")
|
||||
echo "ci.sh: uploading $name"
|
||||
curl -fsS -H "$auth" -F "attachment=@$file" "$api/releases/$id/assets?name=$name" >/dev/null
|
||||
done
|
||||
echo "ci.sh: $os uploaded to $tag"
|
||||
Reference in new issue
Block a user