Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: release workflow #1922

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scripts/cloudbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
def get_target(target):
response = requests.get(f'{URL}/buildtargets/{target}', headers=HEADERS)

print(f'get_target requesr url: "{URL}/buildtargets/{target}"')

if response.status_code == 200:
return response.json()
elif response.status_code == 404:
Expand Down Expand Up @@ -61,6 +63,7 @@ def generate_body(template_target, name, branch, options, remoteCacheStrategy):
# Set target name based on branch, without commit SHA
base_target_name = f'{re.sub(r'^t_', '', os.getenv('TARGET'))}-{re.sub('[^A-Za-z0-9]+', '-', os.getenv('BRANCH_NAME'))}'.lower()

print(f"Start clone_current_target for {base_target_name}")
if is_release_workflow:
# Use the tag version in the target name if it's a release workflow
tag_version = os.getenv('TAG_VERSION', 'unknown-version')
Expand Down Expand Up @@ -90,6 +93,7 @@ def generate_body(template_target, name, branch, options, remoteCacheStrategy):
print(f"Using cache build target: {new_target_name}")
response = requests.put(f'{URL}/buildtargets/{new_target_name}', headers=HEADERS, json=body)

print(f"clone_current_target response status: {response.status_code}")
if response.status_code == 200 or response.status_code == 201:
# Override target ENV
os.environ['TARGET'] = new_target_name
Expand Down
Loading