Skip to content

Update zipit.yml

Update zipit.yml #13

Workflow file for this run

name: Combine and Zip Files
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
zip:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2
- name: Set up zip and rsync
run: sudo apt-get install zip unzip rsync -y
- name: Unzip tweaks.zip
run: unzip tweaks.zip -d tweaks
- name: Copy repository files over tweaks files
run: rsync -av --exclude='tweaks.zip' --exclude='tweaks/' ./ tweaks/
- name: Create pack.zip excluding tweaks.zip and extracted tweaks folder
run: |
cd tweaks
zip -r ../pack.zip . -x "tweaks.zip" "tweaks/"
- name: Check the size of the created pack.zip
run: du -sh pack.zip
- name: Upload pack.zip as a release asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
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"