Skip to content

Commit adef08d

Browse files
committed
v0.4.6
2 parents 3ae8451 + 191a647 commit adef08d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

releaser/releaser.py

+13-10
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def GetListOfArtifacts(argv, files):
5252
if len(argv) > 1:
5353
args += argv[1:]
5454
if len(args) == 1 and args[0].lower() == "none":
55-
print("! Skipping 'files' because it's set to 'none")
55+
print("! Skipping 'files' because it's set to 'none'.")
5656
return []
5757
elif len(args) == 0:
5858
stdout.flush()
@@ -63,7 +63,7 @@ def GetListOfArtifacts(argv, files):
6363
print(f" glob({item!s}):")
6464
for fname in [fname for fname in glob(item, recursive=True) if not Path(fname).is_dir()]:
6565
if Path(fname).stat().st_size == 0:
66-
print(f" - ! Skipping empty file {fname!s}")
66+
print(f" - ! Skipping empty file {fname!s}.")
6767
continue
6868
print(f" - {fname!s}")
6969
flist.append(fname)
@@ -101,7 +101,7 @@ def CheckRefSemVer(gh_ref, tag, snapshots):
101101
return (tag, env_tag, False)
102102
elif snapshots:
103103
# is semver compilant prerelease tag, thus a snapshot (we skip it)
104-
print("! Skipping snapshot prerelease")
104+
print("! Skipping snapshot prerelease.")
105105
sys_exit()
106106

107107
return (tag, env_tag, True)
@@ -179,12 +179,15 @@ def UpdateReference(gh_release, tag, sha, is_prerelease, is_draft):
179179
asset.delete_asset()
180180
stdout.flush()
181181

182-
print("· Cleanup and/or upload artifacts")
183-
env = environ.copy()
184-
env["GITHUB_TOKEN"] = paramToken
185-
cmd = ["gh", "release", "upload", "--repo", paramRepo, "--clobber", tag] + files
186-
print(f" > {' '.join(cmd)}")
187-
check_call(cmd, env=env)
188-
stdout.flush()
182+
if len(files) > 0:
183+
print("· Upload assets")
184+
env = environ.copy()
185+
env["GITHUB_TOKEN"] = paramToken
186+
cmd = ["gh", "release", "upload", "--repo", paramRepo, "--clobber", tag] + files
187+
print(f" > {' '.join(cmd)}")
188+
check_call(cmd, env=env)
189+
stdout.flush()
190+
else:
191+
print("! Skipping uploading assets because the file list is empty.")
189192

190193
UpdateReference(gh_release, tag, paramSHA if env_tag is None else None, is_prerelease, is_draft)

0 commit comments

Comments
 (0)