Skip to content

Commit

Permalink
ci: add size diff to release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
CanadaHonk committed Mar 23, 2023
1 parent 3279282 commit be076a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ jobs:
git push origin --delete nightly || true
git tag nightly
git push origin nightly
curl -L -o old.asar "https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar"
gh release delete ${{ env.VERSION }} -y || true
gh release create ${{ env.VERSION }} -t "Nightly" -n "$(git rev-parse HEAD | cut -c 1-7) | $(git log -1 --pretty=%B)" ${{ env.FILES }}
gh release create ${{ env.VERSION }} -t "Nightly" -n "$(bash scripts/nightlyNotes.sh)" ${{ env.FILES }}
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
VERSION: 'nightly'
Expand Down
8 changes: 8 additions & 0 deletions scripts/nightlyNotes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

echo "$(git rev-parse HEAD | cut -c 1-7) | $(git log -1 --pretty=%B)"

size_old=$(stat -c "%s" old.asar)
size_new=$(stat -c "%s" app.asar)

echo "print(\"%+2.3f KB\" % (($size_new-$size_old)/1000))" | python3

0 comments on commit be076a2

Please sign in to comment.