Skip to content

Zip and Publish Subfolders #26

Zip and Publish Subfolders

Zip and Publish Subfolders #26

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: Set up GitHub CLI
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Create zip files for each subfolder
run: |
for dir in $(find . -mindepth 1 -maxdepth 1 -type d); do
zip_file="${dir##*/}.zip"
zip -r "$zip_file" "$dir"
echo "Created $zip_file"
done
- name: Upload zip files to release
run: |
for zip_file in *.zip; do
echo "Uploading $zip_file"
gh release upload "${{ github.event.release.tag_name }}" "$zip_file"
done