Skip to content

Commit 29c746d

Browse files
committed
Tweaked .gitignore and commit the latest builds.
1 parent 803c8af commit 29c746d

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

build_differ.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
import subprocess
23
import os
34
import tarfile
@@ -39,11 +40,21 @@ def compress_files(source_dir, target_file):
3940
os.path.join(source_dir, '..')))
4041

4142

43+
def cleanup_old_builds(dist_dir, current_version):
44+
"""
45+
Deletes any build files ending in .zip or .tar.gz in the dist_dir with a different version tag.
46+
"""
47+
for file in os.listdir(dist_dir):
48+
if not file.endswith((f'{current_version}.zip', f'{current_version}.tar.gz'), '.gitignore'):
49+
file_path = os.path.join(dist_dir, file)
50+
os.remove(file_path)
51+
print(f"Deleted old build file: {file}")
52+
4253
def main():
4354
version = get_version()
4455
print(f"Version: {version}")
4556

46-
dist_dir = "./src/python_redlines/dist/"
57+
dist_dir = "./dist/"
4758

4859
# Build for Linux
4960
print("Building for Linux...")
@@ -69,6 +80,8 @@ def main():
6980
macos_build_dir = './csproj/bin/Release/net8.0/osx-x64'
7081
compress_files(macos_build_dir, f"{dist_dir}/osx-x64-{version}.tar.gz")
7182

83+
cleanup_old_builds(dist_dir, version)
84+
7285
print("Build and compression complete.")
7386

7487

dist/.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*
2-
!*.tar.gz
3-
!*.zip
4-
!.gitignore
2+
!linux-x64-*.tar.gz
3+
!osx-x64-*.tar.gz
4+
!win-x64-*.zip
5+
!.gitignore`

dist/linux-x64-0.0.4.tar.gz

65.4 MB
Binary file not shown.

dist/osx-x64-0.0.4.tar.gz

64.7 MB
Binary file not shown.

dist/win-x64-0.0.4.zip

67.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)