Skip to content

Commit

Permalink
[release] Let the AI modify the code so it does not create a duplicat…
Browse files Browse the repository at this point in the history
…e release should the Mac or Linux build be faster.
  • Loading branch information
christofmuc committed Aug 8, 2023
1 parent 3374d9c commit e0d967e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/builds-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ jobs:
with:
file: build/KnobKraft_Orm-${{env.ORM_VERSION}}-Darwin.dmg
tags: true
draft: false

1 change: 1 addition & 0 deletions .github/workflows/builds-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
with:
file: builds/KnobKraft_Orm-${{env.ORM_VERSION}}-Linux.tar.gz
tags: true
draft: false

- name: Setup Sentry CLI
uses: mathieu-bour/[email protected]
Expand Down
20 changes: 15 additions & 5 deletions make_github_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,20 @@
"Authorization": f"Bearer {access_token}",
"Accept": "application/vnd.github.v3+json"
}
response = requests.post(url, json=release_payload, headers=headers)

# Check the response status
if response.status_code == 201:
print("Release created successfully.")
# Get existing releases
url_existing_releases = f"https://api.github.com/repos/{repo_owner}/{repo_name}/releases"
existing_releases = requests.get(url_existing_releases, headers=headers).json()

# Check if the release for this version already exists
existing_release = next((release for release in existing_releases if release['tag_name'] == version), None)

if not existing_release:
print("Creating a new release...")
response = requests.post(url, json=release_payload, headers=headers)
if response.status_code == 201:
print("Release created successfully.")
else:
print("Failed to create the release. Response status:", response.status_code)
else:
print("Failed to create the release. Response status:", response.status_code)
print("Found release {version}, skipping creation!")

0 comments on commit e0d967e

Please sign in to comment.