Skip to content

Commit

Permalink
add version to build msg
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkLightTuna committed Jan 30, 2024
1 parent b7e2ebf commit 0685b75
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/foundry_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@
def main():
module_json = get_module_json()

post_update()

if PUSH_RELEASE:
push_release(module_json)

else:
print('SKIPPING RELEASE!')

Expand All @@ -43,7 +40,7 @@ def main():
else:
print('SKIPPING FOUNDRY REPO DESCRIPTION UPDATE')


post_update(module_json['version'])


def get_module_json():
Expand Down Expand Up @@ -136,24 +133,29 @@ def post_packages_oronder_edit(csrf_token, csrf_middleware_token, session_id, de
conn.request('POST', '/packages/oronder/edit', body, headers)
response = conn.getresponse()
if response.status != 200:
raise Exception('Update Description Failed')
content = response.read().decode()
headers = response.headers.as_string()
print(f'{content=}')
print(f'{headers=}')
content = response.read().decode()
headers = response.headers.as_string()
err_msg = f'Update Description Failed\n{content=}\n{headers=}'
raise Exception(err_msg)


def post_update():
def post_update(version):
conn = http.client.HTTPSConnection("api.oronder.com")
conn.request(
"POST", '/update_discord',
headers={
'Content-Type': 'application/json',
'Authorization': UPDATE_DISCORD_KEY
},
body=json.dumps({'changes':CHANGES})
body=json.dumps({'version': VERSION, 'changes': CHANGES})
)
if conn.getresponse().status != 200:
raise Exception('Failed to send Update Message to Discord')
response = conn.getresponse()
if response.status != 200:
content = response.read().decode()
headers = response.headers.as_string()
err_msg = f'Failed to send Update Message to Discord\n{content=}\n{headers=}'
raise Exception(err_msg)


if __name__ == '__main__':
main()

0 comments on commit 0685b75

Please sign in to comment.