Skip to content

Commit

Permalink
show file size in build summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Jun 27, 2023
1 parent 650338c commit a6d33a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/scripts/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def main():

with open(os.environ['GITHUB_STEP_SUMMARY'], 'w') as f:
f.write('## Build Artifacts Summary\n\n')
f.write('| Subproject | for Minecraft | Files | SHA-256 |\n')
f.write('| --- | --- | --- | --- |\n')
f.write('| Subproject | for Minecraft | File | Size | SHA-256 |\n')
f.write('| --- | --- | --- | --- | --- |\n')

warnings = []
for subproject in settings['versions']:
Expand All @@ -56,11 +56,12 @@ def main():
sha256 = '*N/A*'
else:
file_name = '`{}`'.format(os.path.basename(file_paths[0]))
file_size = '{} B'.format(os.path.getsize(file_paths[0]))
sha256 = '`{}`'.format(get_sha256_hash(file_paths[0]))
if len(file_paths) > 1:
warnings.append('Found too many build files in subproject {}: {}'.format(subproject, ', '.join(file_paths)))

f.write('| {} | {} | {} | {} |\n'.format(subproject, game_versions, file_name, sha256))
f.write('| {} | {} | {} | {} | {} |\n'.format(subproject, game_versions, file_name, file_size, sha256))

if len(warnings) > 0:
f.write('\n### Warnings\n\n')
Expand Down

0 comments on commit a6d33a6

Please sign in to comment.