diff --git a/.ci/update_release.py b/.ci/update_release.py index 26ac85e4..f31d78fe 100755 --- a/.ci/update_release.py +++ b/.ci/update_release.py @@ -5,15 +5,20 @@ # SPDX-License-Identifier: Apache-2.0 import pathlib -from ci.util import ctx +from ci.util import ( + check_env, + ctx, +) +import ccc.github + import os from github.util import GitHubRepositoryHelper VERSION_FILE_NAME = 'VERSION' -repo_owner_and_name = util.check_env('SOURCE_GITHUB_REPO_OWNER_AND_NAME') -repo_dir = util.check_env('MAIN_REPO_DIR') +repo_owner_and_name = check_env('SOURCE_GITHUB_REPO_OWNER_AND_NAME') +repo_dir = check_env('MAIN_REPO_DIR') repo_owner, repo_name = repo_owner_and_name.split('/') @@ -25,11 +30,12 @@ cfg_factory = ctx().cfg_factory() github_cfg = cfg_factory.github('github_com') +github_api = ccc.github.github_api(github_cfg) github_repo_helper = GitHubRepositoryHelper( owner=repo_owner, name=repo_name, - github_cfg=github_cfg, + github_api=github_api, ) gh_release = github_repo_helper.repository.release_from_tag(version_file_contents) @@ -40,7 +46,7 @@ except KeyError: print("No integration test output path found. Output will not be added to release") else: - integration_test_path = util.check_env('INTEGRATION_TEST_PATH') + integration_test_path = check_env('INTEGRATION_TEST_PATH') integration_test_path = pathlib.Path(integration_test_path).resolve() integration_test_path = integration_test_path / "integration_test.log" gh_release.upload_asset(