File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ integration-test-docker:
3434 cd /root/.config/nvim && \
3535 make integration-test"
3636
37+ cleanup-binary-tags :
38+ ci/cleanup-binary-tags.py
39+
3740clean :
3841 cargo clean
3942 rm -rf bin/languageclient
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ import subprocess
4+ import re
5+ import semver
6+
7+
8+ def tag_to_version (tag ):
9+ version = re .sub (r'binary-' , '' , tag )
10+ version = re .sub (r'-[x86|i686].*' , '' , version )
11+ return version
12+
13+ subprocess .check_call ('git pull --tags' , shell = True )
14+ tags = subprocess .check_output ('git tag --list | grep binary' , shell = True ).decode ('UTF-8' ).splitlines ()
15+ versions = sorted (list (set ([tag_to_version (tag ) for tag in tags ])), key = semver .parse_version_info )
16+ versions_to_delete = versions [:- 3 ]
17+
18+ cmd_delete_local = 'git tag --delete'
19+ cmd_delete_remote = 'git push --delete origin'
20+ for tag in tags :
21+ if tag_to_version (tag ) in versions_to_delete :
22+ cmd_delete_local += ' ' + tag
23+ cmd_delete_remote += ' ' + tag
24+
25+ if not cmd_delete_local .endswith ('delete' ):
26+ subprocess .check_call (cmd_delete_local , shell = True )
27+ if not cmd_delete_remote .endswith ('origin' ):
28+ subprocess .check_call (cmd_delete_remote , shell = True )
You can’t perform that action at this time.
0 commit comments