Skip to content

Commit 2b9e527

Browse files
committed
Fixing duplicate upload issue during deploy
1 parent 81f07c5 commit 2b9e527

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

installer/build_server.py

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def upload(file_path, github_release):
172172
# Attempt the upload
173173
with open(file_path, "rb") as f:
174174
# Upload to GitHub
175+
output("GitHub: Uploading asset from %s: %s" % (github_release.tag_name, file_name))
175176
asset = github_release.upload_asset("application/octet-stream", file_name, f)
176177
url = asset.to_json()["browser_download_url"]
177178
# Successfully uploaded!

installer/deploy.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@
169169
# NOTE: ONLY for `openshot-qt` repo
170170
# github_release_url = github_release.html_url
171171
github_release = releases.get('openshot-qt')
172-
for artifact_orig_name in os.listdir(artifact_dir):
172+
for artifact_orig_name in os.listdir(artifact_dir).copy():
173+
print("--- %s" % artifact_orig_name)
173174
artifact_path_orig = os.path.join(artifact_dir, artifact_orig_name)
174175
match = RELEASE_NAME_REGEX.match(artifact_orig_name)
175176
if match and match.groups():
@@ -184,14 +185,13 @@
184185
artifact_path = artifact_path_orig
185186
artifact_base, artifact_ext = os.path.splitext(artifact_name)
186187

187-
if artifact_ext == '.torrent':
188+
if artifact_ext in ['.torrent', '.verify', '.sha256sum']:
188189
# Delete torrent and continue (we'll recreate the torrents below when needed)
189190
# The artifact torrents have the incorrect URL inside them
190191
os.unlink(artifact_path)
191192
continue
192193

193-
if os.path.exists(artifact_path) and artifact_ext in ['.exe', '.dmg', '.AppImage',
194-
'.verify', '.sha256sum']:
194+
if os.path.exists(artifact_path) and artifact_ext in ['.exe', '.dmg', '.AppImage']:
195195
# Valid artifact/installer - Upload to GitHub Release
196196
output("GitHub: Uploading %s to GitHub Release: %s" % (artifact_path, github_release.tag_name))
197197
download_url = upload(artifact_path, github_release)

0 commit comments

Comments
 (0)