Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e362a65
Merge pull request #5 from JSv4/JSv4/bump-version-and-add-note-to-docs
JSv4 Apr 1, 2024
83a7e25
Build custom build action yaml and improve packaging script.
JSv4 Apr 1, 2024
00d3ae6
Remove unwanted binary in VCS
JSv4 Apr 1, 2024
2025e84
Changed build hook invocation to not rely on hatch.
JSv4 Apr 1, 2024
2314e5f
Add log lines.
JSv4 Apr 1, 2024
af22191
Verified build hook working via github pip dist. Unpackage script has…
JSv4 Apr 1, 2024
3c833e4
Updated unzip function to not overwrite existing binaries unless a fl…
JSv4 Apr 1, 2024
995fb8d
Add support for macOS in build and extraction process
rishabh-sagar-20 Apr 2, 2024
342c214
Fix numbering in developer guide documentation
rishabh-sagar-20 Apr 2, 2024
4ee2e99
Merge pull request #7 from SpotDraft/fix-binary-extraction-flow
JSv4 Apr 2, 2024
bd8545b
Added a workflow to build the latest differs.
JSv4 Apr 2, 2024
841a1bb
Update name of GitHub action workflow.
JSv4 Apr 2, 2024
803c8af
Updated dist .gitignore.
JSv4 Apr 2, 2024
29c746d
Tweaked .gitignore and commit the latest builds.
JSv4 Apr 2, 2024
b47ee1b
Fix typo.
JSv4 Apr 2, 2024
f9087c9
Revised build yaml
JSv4 Apr 2, 2024
ff165aa
Went back to build hook to try to get builds to be cleaner and keep b…
JSv4 Apr 2, 2024
54dd769
Drop the build workflow.
JSv4 Apr 2, 2024
0cd7a75
Merge pull request #6 from JSv4/JSv4/work-on-build-and-dist-infra
JSv4 Apr 2, 2024
13d7061
Bump version tag
JSv4 Apr 2, 2024
19a7d5a
Drop binaries.
JSv4 Apr 2, 2024
01eb785
Drop binaries.
JSv4 Apr 2, 2024
f7133bb
Merge branch 'main' of https://github.com/JSv4/Python-Docx-Redlines
JSv4 Apr 2, 2024
35a0fef
Updated publish workflow.
JSv4 Apr 2, 2024
91c945f
Tweak pyproject include.
JSv4 Apr 2, 2024
a834070
Drop dependency on hatch from build hook (again... lost this in the P…
JSv4 Apr 2, 2024
cc042da
add arm support
ross-mcnairn-dev May 29, 2024
10fa4f9
add windows arm64, patch READMEs
ross-mcnairn-dev May 30, 2024
3987569
parametrise target path
ross-mcnairn-dev May 31, 2024
3998921
Merge pull request #9 from ross-mcnairn-dev/main
JSv4 Jun 4, 2024
67b97a3
Merge pull request #2 from JSv4/main
ross-mcnairn-dev Jun 4, 2024
30d2a45
Merge branch 'main' into parametrise_target
ross-mcnairn-dev Jun 4, 2024
254e742
Merge pull request #10 from ross-mcnairn-dev/parametrise_target
JSv4 Jun 24, 2024
2003706
feat: Add FastAPI service for document redlining
google-labs-jules[bot] Oct 7, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add arm support
  • Loading branch information
ross-mcnairn-dev committed May 29, 2024
commit cc042da4cf2648cbdf1dcf07df7c1c1a795bb57c
42 changes: 29 additions & 13 deletions build_differ.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,45 @@ def main():

dist_dir = "./src/python_redlines/dist/"

# Build for Linux
print("Building for Linux...")
# Build for Linux x64
print("Building for Linux x64...")
run_command('dotnet publish ./csproj -c Release -r linux-x64 --self-contained')

# Build for Windows
print("Building for Windows...")
# Build for Linux ARM64
print("Building for Linux ARM64...")
run_command('dotnet publish ./csproj -c Release -r linux-arm64 --self-contained')

# Build for Windows x64
print("Building for Windows x64...")
run_command('dotnet publish ./csproj -c Release -r win-x64 --self-contained')

# Build for macOS
print("Building for macOS...")
# Build for macOS x64
print("Building for macOS x64...")
run_command('dotnet publish ./csproj -c Release -r osx-x64 --self-contained')

# Compress the Linux build
linux_build_dir = './csproj/bin/Release/net8.0/linux-x64'
compress_files(linux_build_dir, f"{dist_dir}/linux-x64-{version}.tar.gz")
# Build for macOS ARM64
print("Building for macOS ARM64...")
run_command('dotnet publish ./csproj -c Release -r osx-arm64 --self-contained')

# Compress the Linux x64 build
linux_x64_build_dir = './csproj/bin/Release/net8.0/linux-x64'
compress_files(linux_x64_build_dir, f"{dist_dir}/linux-x64-{version}.tar.gz")

# Compress the Windows build
# Compress the Linux ARM64 build
linux_arm64_build_dir = './csproj/bin/Release/net8.0/linux-arm64'
compress_files(linux_arm64_build_dir, f"{dist_dir}/linux-arm64-{version}.tar.gz")

# Compress the Windows x64 build
windows_build_dir = './csproj/bin/Release/net8.0/win-x64'
compress_files(windows_build_dir, f"{dist_dir}/win-x64-{version}.zip")

# Compress the macOS build
macos_build_dir = './csproj/bin/Release/net8.0/osx-x64'
compress_files(macos_build_dir, f"{dist_dir}/osx-x64-{version}.tar.gz")
# Compress the macOS x64 build
macos_x64_build_dir = './csproj/bin/Release/net8.0/osx-x64'
compress_files(macos_x64_build_dir, f"{dist_dir}/osx-x64-{version}.tar.gz")

# Compress the macOS ARM64 build
macos_arm64_build_dir = './csproj/bin/Release/net8.0/osx-arm64'
compress_files(macos_arm64_build_dir, f"{dist_dir}/osx-arm64-{version}.tar.gz")

cleanup_old_builds(dist_dir, version)

Expand Down
15 changes: 11 additions & 4 deletions src/python_redlines/engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,26 @@ def __get_binaries_info(self):
zip_name: str - The name of the zip file
"""
os_name = platform.system().lower()
arch = 'x64' # Assuming x64 architecture
arch = platform.machine().lower()

if arch in ('x86_64', 'amd64'):
arch = 'x64'
elif arch in ('arm64', 'aarch64'):
arch = 'arm64'
else:
raise EnvironmentError(f"Unsupported architecture: {arch}")

if os_name == 'linux':
zip_name = f"linux-{arch}-{__version__}.tar.gz"
binary_name = 'linux-x64/redlines'
binary_name = f'linux-{arch}/redlines'

elif os_name == 'windows':
zip_name = f"win-{arch}-{__version__}.zip"
binary_name = 'win-x64/redlines.exe'
binary_name = f'win-{arch}/redlines.exe'

elif os_name == 'darwin':
zip_name = f"osx-{arch}-{__version__}.tar.gz"
binary_name = 'osx-x64/redlines'
binary_name = f'osx-{arch}/redlines'

else:
raise EnvironmentError("Unsupported OS")
Expand Down