|
1 | | -import re |
2 | 1 | import subprocess |
3 | 2 | import os |
4 | 3 | import tarfile |
@@ -50,35 +49,56 @@ def cleanup_old_builds(dist_dir, current_version): |
50 | 49 | os.remove(file_path) |
51 | 50 | print(f"Deleted old build file: {file}") |
52 | 51 |
|
| 52 | + |
53 | 53 | def main(): |
54 | 54 | version = get_version() |
55 | 55 | print(f"Version: {version}") |
56 | 56 |
|
57 | 57 | dist_dir = "./src/python_redlines/dist/" |
58 | 58 |
|
59 | | - # Build for Linux |
60 | | - print("Building for Linux...") |
| 59 | + # Build for Linux x64 |
| 60 | + print("Building for Linux x64...") |
61 | 61 | run_command('dotnet publish ./csproj -c Release -r linux-x64 --self-contained') |
62 | 62 |
|
63 | | - # Build for Windows |
64 | | - print("Building for Windows...") |
| 63 | + # Build for Linux ARM64 |
| 64 | + print("Building for Linux ARM64...") |
| 65 | + run_command('dotnet publish ./csproj -c Release -r linux-arm64 --self-contained') |
| 66 | + |
| 67 | + # Build for Windows x64 |
| 68 | + print("Building for Windows x64...") |
65 | 69 | run_command('dotnet publish ./csproj -c Release -r win-x64 --self-contained') |
66 | 70 |
|
67 | | - # Build for macOS |
68 | | - print("Building for macOS...") |
| 71 | + # Build for Windows ARM64 |
| 72 | + print("Building for Windows ARM64...") |
| 73 | + run_command('dotnet publish ./csproj -c Release -r win-arm64 --self-contained') |
| 74 | + |
| 75 | + # Build for macOS x64 |
| 76 | + print("Building for macOS x64...") |
69 | 77 | run_command('dotnet publish ./csproj -c Release -r osx-x64 --self-contained') |
70 | 78 |
|
71 | | - # Compress the Linux build |
72 | | - linux_build_dir = './csproj/bin/Release/net8.0/linux-x64' |
73 | | - compress_files(linux_build_dir, f"{dist_dir}/linux-x64-{version}.tar.gz") |
| 79 | + # Build for macOS ARM64 |
| 80 | + print("Building for macOS ARM64...") |
| 81 | + run_command('dotnet publish ./csproj -c Release -r osx-arm64 --self-contained') |
74 | 82 |
|
75 | | - # Compress the Windows build |
| 83 | + # Compress the Linux x64 build |
| 84 | + linux_x64_build_dir = './csproj/bin/Release/net8.0/linux-x64' |
| 85 | + compress_files(linux_x64_build_dir, f"{dist_dir}/linux-x64-{version}.tar.gz") |
| 86 | + |
| 87 | + # Compress the Linux ARM64 build |
| 88 | + linux_arm64_build_dir = './csproj/bin/Release/net8.0/linux-arm64' |
| 89 | + compress_files(linux_arm64_build_dir, f"{dist_dir}/linux-arm64-{version}.tar.gz") |
| 90 | + |
| 91 | + # Compress the Windows x64 build |
76 | 92 | windows_build_dir = './csproj/bin/Release/net8.0/win-x64' |
77 | 93 | compress_files(windows_build_dir, f"{dist_dir}/win-x64-{version}.zip") |
78 | 94 |
|
79 | | - # Compress the macOS build |
80 | | - macos_build_dir = './csproj/bin/Release/net8.0/osx-x64' |
81 | | - compress_files(macos_build_dir, f"{dist_dir}/osx-x64-{version}.tar.gz") |
| 95 | + # Compress the macOS x64 build |
| 96 | + macos_x64_build_dir = './csproj/bin/Release/net8.0/osx-x64' |
| 97 | + compress_files(macos_x64_build_dir, f"{dist_dir}/osx-x64-{version}.tar.gz") |
| 98 | + |
| 99 | + # Compress the macOS ARM64 build |
| 100 | + macos_arm64_build_dir = './csproj/bin/Release/net8.0/osx-arm64' |
| 101 | + compress_files(macos_arm64_build_dir, f"{dist_dir}/osx-arm64-{version}.tar.gz") |
82 | 102 |
|
83 | 103 | cleanup_old_builds(dist_dir, version) |
84 | 104 |
|
|
0 commit comments