Skip to content

Commit a8ab257

Browse files
committed
Merge branch hotfix/v9.0.4 into develop
2 parents bfd3bb0 + a640943 commit a8ab257

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1375
-1447
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Git Operations
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
operation:
7+
description: 'Operation to perform'
8+
required: true
9+
type: choice
10+
options:
11+
- create
12+
- remove
13+
default: 'create'
14+
15+
branch_name:
16+
description: 'Branch name to create or remove'
17+
required: true
18+
type: string
19+
20+
base_branch:
21+
description: 'Base branch to work from (for create operation)'
22+
required: false
23+
type: string
24+
default: 'develop'
25+
26+
branding:
27+
description: 'Branding name'
28+
required: false
29+
type: string
30+
default: 'onlyoffice'
31+
32+
branding_url:
33+
description: 'Branding repository URL (relative to git host)'
34+
required: false
35+
type: string
36+
default: 'ONLYOFFICE/onlyoffice.git'
37+
38+
jobs:
39+
git-operations:
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v4
45+
with:
46+
path: ONLYOFFICE/build_tools
47+
token: ${{ secrets.GITHUB_TOKEN }}
48+
fetch-depth: 0
49+
50+
- name: Set up Python
51+
uses: actions/setup-python@v4
52+
with:
53+
python-version: '3.x'
54+
55+
- name: Install dependencies
56+
run: |
57+
python -m pip install --upgrade pip
58+
# Install any Python dependencies if requirements.txt exists
59+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
60+
61+
- name: Configure Git
62+
run: |
63+
git config --global user.name "GitHub Actions Bot"
64+
git config --global user.email "[email protected]"
65+
66+
- name: Run Git Operations
67+
run: |
68+
cd ONLYOFFICE/build_tools/scripts/develop
69+
python git_operations.py ${{ inputs.operation }} "${{ inputs.branch_name }}" \
70+
--base-branch="${{ inputs.base_branch }}" \
71+
--branding="${{ inputs.branding }}" \
72+
--branding-url="${{ inputs.branding_url }}" \
73+
--modules="${{ inputs.modules }}"
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
77+
- name: Operation Summary
78+
run: |
79+
echo "## Git Operations Summary" >> $GITHUB_STEP_SUMMARY
80+
echo "- **Operation**: ${{ inputs.operation }}" >> $GITHUB_STEP_SUMMARY
81+
echo "- **Branch Name**: ${{ inputs.branch_name }}" >> $GITHUB_STEP_SUMMARY
82+
echo "- **Base Branch**: ${{ inputs.base_branch }}" >> $GITHUB_STEP_SUMMARY
83+
echo "- **Branding**: ${{ inputs.branding }}" >> $GITHUB_STEP_SUMMARY
84+
echo "- **Branding URL**: ${{ inputs.branding_url }}" >> $GITHUB_STEP_SUMMARY
85+
echo "- **Modules**: ${{ inputs.modules }}" >> $GITHUB_STEP_SUMMARY
86+
if [ "${{ inputs.operation }}" = "remove" ] && [ "${{ inputs.force_remove }}" = "true" ]; then
87+
echo "- **Force Remove**: Yes" >> $GITHUB_STEP_SUMMARY
88+
fi

Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ ENV TZ=Etc/UTC
44
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
55

66
RUN apt-get -y update && \
7-
apt-get -y install python \
8-
python3 \
7+
apt-get -y install tar \
98
sudo
10-
RUN rm /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python
9+
1110
ADD . /build_tools
1211
WORKDIR /build_tools
1312

13+
RUN mkdir -p /opt/python3 && \
14+
tar -xzf /build_tools/tools/linux/python3.tar.gz -C /opt/python3 --strip-components=1
15+
16+
ENV PATH="/opt/python3/bin:${PATH}"
17+
18+
RUN ln -s /opt/python3/bin/python3.10 /usr/bin/python
19+
1420
CMD ["sh", "-c", "cd tools/linux && python3 ./automate.py"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ necessary for the compilation process, all the dependencies required for the
88
correct work, as well as to get the latest version of
99
**ONLYOFFICE products** source code and build all their components.
1010

11-
**Important!** We can only guarantee the correct work of the products built from
12-
the `master` branch.
11+
**Important!** We can only guarantee the correct work of the products built
12+
from the `master` branch.
1313

1414
## How to use - Linux
1515

defaults

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
sdkjs-plugin="photoeditor, macros, ocr, translator, thesaurus, youtube, highlightcode, zotero"
2-
sdkjs-plugin-server="speech, zotero, mendeley, speechrecognition, drawio"
1+
sdkjs-plugin="ai, photoeditor, ocr, translator, thesaurus, youtube, highlightcode"
2+
sdkjs-plugin-server="speech, zotero, mendeley, speechrecognition"
33
sdkjs-addons="sdkjs-forms"

develop/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ but don't want to compile pretty compilcated core product to make those changes.
66

77
## System requirements
88

9+
**Note**: ARM-based architectures are currently **NOT** supported;
10+
attempting to run the images on ARM devices may result in startup failures
11+
or other runtime issues.
12+
913
### Windows
1014

1115
You need the latest

scripts/base.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,27 @@ def git_get_origin():
521521
os.chdir(cur_dir)
522522
return ret
523523

524+
def git_get_base_url():
525+
"""Get the base URL for git operations, with fallback to GitHub"""
526+
origin = git_get_origin()
527+
if origin:
528+
# Extract base URL from origin
529+
if origin.startswith("https://"):
530+
# For HTTPS URLs like https://git.example.com/owner/repo.git
531+
parts = origin.split("/")
532+
if len(parts) >= 4:
533+
return "/".join(parts[:3]) + "/"
534+
elif ":" in origin and "@" in origin:
535+
# For SSH URLs like [email protected]:owner/repo.git
536+
at_pos = origin.find("@")
537+
colon_pos = origin.find(":", at_pos)
538+
if at_pos != -1 and colon_pos != -1:
539+
host = origin[at_pos+1:colon_pos]
540+
return f"https://{host}/"
541+
542+
# Fallback to GitHub
543+
return "https://github.com/"
544+
524545
def git_is_ssh():
525546
git_protocol = config.option("git-protocol")
526547
if (git_protocol == "https"):
@@ -542,7 +563,7 @@ def get_ssh_base_url():
542563
def git_update(repo, is_no_errors=False, is_current_dir=False, git_owner=""):
543564
print("[git] update: " + repo)
544565
owner = git_owner if git_owner else "ONLYOFFICE"
545-
url = "https://github.com/" + owner + "/" + repo + ".git"
566+
url = git_get_base_url() + owner + "/" + repo + ".git"
546567
if git_is_ssh():
547568
url = get_ssh_base_url() + repo + ".git"
548569
folder = get_script_dir() + "/../../" + repo
@@ -614,7 +635,7 @@ def get_branding_repositories(checker):
614635

615636
def create_pull_request(branches_to, repo, is_no_errors=False, is_current_dir=False):
616637
print("[git] create pull request: " + repo)
617-
url = "https://github.com/ONLYOFFICE/" + repo + ".git"
638+
url = git_get_base_url() + "ONLYOFFICE/" + repo + ".git"
618639
if git_is_ssh():
619640
url = get_ssh_base_url() + repo + ".git"
620641
folder = get_script_dir() + "/../../" + repo
@@ -1288,9 +1309,9 @@ def mac_correct_rpath_desktop(dir):
12881309
os.chdir(dir)
12891310
mac_correct_rpath_library("hunspell", [])
12901311
mac_correct_rpath_library("ooxmlsignature", ["kernel"])
1291-
mac_correct_rpath_library("ascdocumentscore", ["UnicodeConverter", "kernel", "graphics", "kernel_network", "PdfFile", "XpsFile", "DjVuFile", "hunspell", "ooxmlsignature"])
1312+
mac_correct_rpath_library("ascdocumentscore", ["UnicodeConverter", "kernel", "graphics", "kernel_network", "PdfFile", "XpsFile", "DjVuFile", "hunspell", "ooxmlsignature", "doctrenderer"])
12921313
cmd("install_name_tool", ["-change", "@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework", "@rpath/Chromium Embedded Framework.framework/Chromium Embedded Framework", "libascdocumentscore.dylib"])
1293-
mac_correct_rpath_binary("./editors_helper.app/Contents/MacOS/editors_helper", ["ascdocumentscore", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "hunspell", "ooxmlsignature"])
1314+
mac_correct_rpath_binary("./editors_helper.app/Contents/MacOS/editors_helper", ["ascdocumentscore", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "hunspell", "ooxmlsignature", "doctrenderer"])
12941315
cmd("install_name_tool", ["-add_rpath", "@executable_path/../../../../Frameworks", "./editors_helper.app/Contents/MacOS/editors_helper"], True)
12951316
cmd("install_name_tool", ["-add_rpath", "@executable_path/../../../../Resources/converter", "./editors_helper.app/Contents/MacOS/editors_helper"], True)
12961317
cmd("chmod", ["-v", "+x", "./editors_helper.app/Contents/MacOS/editors_helper"])
@@ -1407,7 +1428,7 @@ def copy_sdkjs_plugins(dst_dir, is_name_as_guid=False, is_desktop_local=False, i
14071428
plugins_dir = __file__script__path__ + "/../../onlyoffice.github.io/sdkjs-plugins/content"
14081429
plugins_list_config = config.option("sdkjs-plugin")
14091430
if isXp:
1410-
plugins_list_config="photoeditor, macros, highlightcode, doc2md"
1431+
plugins_list_config="photoeditor, highlightcode, doc2md"
14111432
if ("" == plugins_list_config):
14121433
return
14131434
plugins_list = plugins_list_config.rsplit(", ")
@@ -1856,4 +1877,3 @@ def setup_local_qmake(dir_qmake):
18561877
dir_base = os.path.dirname(dir_qmake)
18571878
writeFile(dir_base + "/onlyoffice_qt.conf", "Prefix = " + dir_base)
18581879
return
1859-

scripts/build_js.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ def make():
109109

110110
# JS build
111111
def _run_npm(directory):
112-
return base.cmd_in_dir(directory, "npm", ["install"])
112+
retValue = base.cmd_in_dir(directory, "npm", ["install"], True)
113+
if (0 != retValue):
114+
retValue = base.cmd_in_dir(directory, "npm", ["install", "--verbose"])
115+
return retValue
113116

114117
def _run_npm_ci(directory):
115118
return base.cmd_in_dir(directory, "npm", ["ci"])
@@ -122,7 +125,7 @@ def _run_grunt(directory, params=[]):
122125

123126
def build_interface(directory):
124127
_run_npm(directory)
125-
_run_grunt(directory, ["--force"] + base.web_apps_addons_param())
128+
_run_grunt(directory, ["--force", "--verbose"] + base.web_apps_addons_param())
126129
return
127130

128131
def get_build_param(minimize=True):

scripts/core_common/make_common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import hunspell
2222
import glew
2323
import harfbuzz
24+
import oo_brotli
2425
import hyphen
2526
import googletest
2627
import libvlc
@@ -51,6 +52,7 @@ def make():
5152
glew.make()
5253
hyphen.make()
5354
googletest.make()
55+
oo_brotli.make()
5456

5557
if config.check_option("build-libvlc", "1"):
5658
libvlc.make()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python
2+
3+
import sys
4+
sys.path.append('../..')
5+
import base
6+
import os
7+
8+
def make():
9+
print("[fetch & build]: brotli")
10+
base.cmd_in_dir(base.get_script_dir() + "/../../core/Common/3dParty/brotli", "./make.py")
11+
return
12+
13+
if __name__ == '__main__':
14+
# manual compile
15+
make()

scripts/deploy_builder.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ def make():
127127
base.mac_correct_rpath_docbuilder(root_dir)
128128

129129
base.create_x2t_js_cache(root_dir, "builder", platform)
130+
131+
base.create_dir(root_dir + "/fonts")
132+
base.copy_dir(git_dir + "/core-fonts/asana", root_dir + "/fonts/asana")
133+
base.copy_dir(git_dir + "/core-fonts/caladea", root_dir + "/fonts/caladea")
134+
base.copy_dir(git_dir + "/core-fonts/crosextra", root_dir + "/fonts/crosextra")
135+
base.copy_dir(git_dir + "/core-fonts/openoffice", root_dir + "/fonts/openoffice")
136+
base.copy_file(git_dir + "/core-fonts/ASC.ttf", root_dir + "/fonts/ASC.ttf")
130137

131138
# delete unnecessary builder files
132139
def delete_files(files):
@@ -143,7 +150,7 @@ def delete_files(files):
143150
base.delete_dir(root_dir + "/sdkjs/cell/css")
144151
base.delete_file(root_dir + "/sdkjs/pdf/src/engine/viewer.js")
145152
base.delete_file(root_dir + "/sdkjs/common/spell/spell/spell.js.mem")
146-
base.delete_dir(root_dir + "/sdkjs/common/Images")
153+
base.delete_dir(root_dir + "/sdkjs/common/Images")
147154

148155
return
149156

0 commit comments

Comments
 (0)