diff --git a/.teamcity/package-windows.sh b/.teamcity/package-windows.sh index a4b91d93..6715af92 100755 --- a/.teamcity/package-windows.sh +++ b/.teamcity/package-windows.sh @@ -15,4 +15,5 @@ for arch in ${windowsArchs[@]}; do make cloudflared-msi # Copy msi into final directory mv cloudflared-$VERSION-$arch.msi $FINAL_ARTIFACT_DIR/cloudflared-windows-$arch.msi + cp $BUILT_ARTIFACT_DIR/cloudflared-windows-$arch.exe $FINAL_ARTIFACT_DIR/cloudflared-windows-$arch.exe done diff --git a/github_release.py b/github_release.py index db612086..8773fc43 100755 --- a/github_release.py +++ b/github_release.py @@ -214,9 +214,6 @@ def main(): """ Attempts to upload Asset to Github Release. Creates Release if it doesn't exist """ try: args = parse_args() - client = Github(args.api_key) - repo = client.get_repo(CLOUDFLARED_REPO) - release = get_or_create_release(repo, args.release_version, args.dry_run) if args.dry_run: if os.path.isdir(args.path): @@ -229,17 +226,21 @@ def main(): else: logging.error("dryrun failed") return - - if os.path.isdir(args.path): - onlyfiles = [f for f in listdir(args.path) if isfile(join(args.path, f))] - for filename in onlyfiles: - binary_path = os.path.join(args.path, filename) - upload_asset(release, binary_path, filename, args.release_version, args.kv_account_id, args.namespace_id, - args.kv_api_token) - move_asset(binary_path, filename) else: - upload_asset(release, args.path, args.name, args.release_version, args.kv_account_id, args.namespace_id, - args.kv_api_token) + client = Github(args.api_key) + repo = client.get_repo(CLOUDFLARED_REPO) + release = get_or_create_release(repo, args.release_version, args.dry_run) + + if os.path.isdir(args.path): + onlyfiles = [f for f in listdir(args.path) if isfile(join(args.path, f))] + for filename in onlyfiles: + binary_path = os.path.join(args.path, filename) + upload_asset(release, binary_path, filename, args.release_version, args.kv_account_id, args.namespace_id, + args.kv_api_token) + move_asset(binary_path, filename) + else: + upload_asset(release, args.path, args.name, args.release_version, args.kv_account_id, args.namespace_id, + args.kv_api_token) except Exception as e: logging.exception(e)