Zip and Publish Subfolders #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |