Skip to content

Commit

Permalink
Update zipit.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel99j2 authored Jul 11, 2024
1 parent 6db6725 commit 1257e8d
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/zipit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,21 @@ jobs:
cd tweaks
zip -r ../pack.zip . -x "tweaks.zip" "tweaks/"
- name: Commit and push pack.zip
- name: Check the size of the created pack.zip
run: du -sh pack.zip

- name: Upload pack.zip as a release asset
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add pack.zip
git commit -m 'Add generated pack.zip'
git push https://${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git HEAD:main
tag=$(date +%Y%m%d%H%M%S)
release_id=$(curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"$tag\", \"name\": \"$tag\", \"draft\": false, \"prerelease\": false}" \
https://api.github.com/repos/${{ github.repository }}/releases | jq -r .id)
curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/zip" \
--data-binary @pack.zip \
"https://uploads.github.com/repos/${{ github.repository }}/releases/$release_id/assets?name=pack.zip"

0 comments on commit 1257e8d

Please sign in to comment.