Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
LukicMMikroe committed May 14, 2024
1 parent 97e1d3f commit fb94b7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: Release Asset Upload Workflow

on:
push:
tags:
- '*'
# on:
# release:
# types: [published]
release:
types: [published]

jobs:
upload-release-asset:
Expand Down
22 changes: 12 additions & 10 deletions scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,18 +514,20 @@ def hash_directory_contents(directory):
return combined_hash

def fetch_current_metadata(repo, token):
url = f"https://api.github.com/repos/{repo}/releases/latest"
url = f"https://api.github.com/repos/{repo}/releases"
headers = {'Authorization': f'token {token}'}
response = requests.get(url, headers=headers)
release_info = response.json()
print(f"Release info: {release_info}")
for asset in release_info.get('assets', []):
if asset['name'] == 'metadata.json':
print("Found metadata.json")
metadata_url = asset['url']
print("Attempting to download metadata from:", metadata_url)
metadata_response = fetch_json_data(metadata_url, token)
return metadata_response
releases = response.json()
if len(releases) > 1:
previous_release = releases[1]
print(f"Release info: {previous_release}")
for asset in previous_release.get('assets', []):
if asset['name'] == 'metadata.json':
print("Found metadata.json")
metadata_url = asset['url']
print("Attempting to download metadata from:", metadata_url)
metadata_response = fetch_json_data(metadata_url, token)
return metadata_response
return []

def update_metadata(current_metadata, new_files, version):
Expand Down

0 comments on commit fb94b7a

Please sign in to comment.