Skip to content

Zip and Publish Subfolders #24

Zip and Publish Subfolders

Zip and Publish Subfolders #24

name: Zip and Publish Subfolders
on:
release:
types: [published]
jobs:
zip-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create zip files for each subfolder and upload as artifacts
run: |
for dir in $(find . -mindepth 1 -maxdepth 1 -type d); do
zip_file="${dir##*/}.zip"
zip -r "$zip_file" "$dir"
echo "Uploading $zip_file"
gh api \
-X POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/actions/artifacts \
-F name="${dir##*/}" \
-F file=@"$zip_file"
done