Skip to content

Commit 86f3300

Browse files
committed
TUN-8585: Avoid creating GH client when dry-run is true
- copy exe files from windows build
1 parent bd9e020 commit 86f3300

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

.teamcity/package-windows.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ for arch in ${windowsArchs[@]}; do
1515
make cloudflared-msi
1616
# Copy msi into final directory
1717
mv cloudflared-$VERSION-$arch.msi $FINAL_ARTIFACT_DIR/cloudflared-windows-$arch.msi
18+
cp $BUILT_ARTIFACT_DIR/cloudflared-windows-$arch.exe $FINAL_ARTIFACT_DIR/cloudflared-windows-$arch.exe
1819
done

github_release.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,6 @@ def main():
214214
""" Attempts to upload Asset to Github Release. Creates Release if it doesn't exist """
215215
try:
216216
args = parse_args()
217-
client = Github(args.api_key)
218-
repo = client.get_repo(CLOUDFLARED_REPO)
219-
release = get_or_create_release(repo, args.release_version, args.dry_run)
220217

221218
if args.dry_run:
222219
if os.path.isdir(args.path):
@@ -229,17 +226,21 @@ def main():
229226
else:
230227
logging.error("dryrun failed")
231228
return
232-
233-
if os.path.isdir(args.path):
234-
onlyfiles = [f for f in listdir(args.path) if isfile(join(args.path, f))]
235-
for filename in onlyfiles:
236-
binary_path = os.path.join(args.path, filename)
237-
upload_asset(release, binary_path, filename, args.release_version, args.kv_account_id, args.namespace_id,
238-
args.kv_api_token)
239-
move_asset(binary_path, filename)
240229
else:
241-
upload_asset(release, args.path, args.name, args.release_version, args.kv_account_id, args.namespace_id,
242-
args.kv_api_token)
230+
client = Github(args.api_key)
231+
repo = client.get_repo(CLOUDFLARED_REPO)
232+
release = get_or_create_release(repo, args.release_version, args.dry_run)
233+
234+
if os.path.isdir(args.path):
235+
onlyfiles = [f for f in listdir(args.path) if isfile(join(args.path, f))]
236+
for filename in onlyfiles:
237+
binary_path = os.path.join(args.path, filename)
238+
upload_asset(release, binary_path, filename, args.release_version, args.kv_account_id, args.namespace_id,
239+
args.kv_api_token)
240+
move_asset(binary_path, filename)
241+
else:
242+
upload_asset(release, args.path, args.name, args.release_version, args.kv_account_id, args.namespace_id,
243+
args.kv_api_token)
243244

244245
except Exception as e:
245246
logging.exception(e)

0 commit comments

Comments
 (0)