-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (27 loc) · 933 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Zip Folders on Release
on:
release:
types: [published]
jobs:
zip_folders:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: List modified folders
id: modified_folders
run: |
git diff --name-only ${{ github.event.release.target_commitish }} HEAD | grep '/' | cut -d/ -f1 | sort -u > modified_folders.txt
cat modified_folders.txt
- name: Create and upload zip files
run: |
while IFS= read -r folder; do
cd "$folder" || exit
zip -r "../$folder.zip" . -x "*/$folder/*" "*_$folder.zip"
cd ..
mv "$folder.zip" "$folder-${{ github.event.release.tag_name }}.zip"
echo "Created and uploaded $folder-${{ github.event.release.tag_name }}.zip"
done < modified_folders.txt
rm modified_folders.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}