|
1 |
| -name: Zip Folders and Upload to GitHub Release |
| 1 | +name: Zip and Upload Folders |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | workflow_dispatch:
|
|
8 | 8 | runs-on: ubuntu-latest
|
9 | 9 |
|
10 | 10 | steps:
|
11 |
| - - name: Checkout repository |
12 |
| - uses: actions/checkout@v4 |
| 11 | + - name: Checkout repository |
| 12 | + uses: actions/checkout@v4 |
13 | 13 |
|
14 |
| - - name: Find folders and zip them |
15 |
| - id: zip |
16 |
| - run: | |
17 |
| - mkdir -p zip_outputs |
18 |
| - for dir in */ ; do |
19 |
| - if [[ "$dir" != ".github/" && -d "$dir" ]]; then |
20 |
| - name="${dir%/}" |
21 |
| - echo "Zipping $name..." |
22 |
| - zip -r "zip_outputs/${name}.zip" "$name" -x "$name/README.md" |
23 |
| - fi |
24 |
| - done |
| 14 | + - name: Create zip files for each folder (excluding .github and README.md) |
| 15 | + run: | |
| 16 | + mkdir -p zip_outputs |
| 17 | + for dir in */ ; do |
| 18 | + folder=$(basename "$dir") |
| 19 | + if [ "$folder" != ".github" ]; then |
| 20 | + zip -r "zip_outputs/${folder}.zip" "$dir" -x "${dir}README.md" |
| 21 | + fi |
| 22 | + done |
25 | 23 |
|
26 |
| - - name: Get latest release tag |
27 |
| - id: get_release |
28 |
| - run: | |
29 |
| - tag=$(gh release list --limit 1 --json tagName -q '.[0].tagName') |
30 |
| - echo "Latest tag is: $tag" |
31 |
| - echo "tag=$tag" >> $GITHUB_OUTPUT |
32 |
| - env: |
33 |
| - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + - name: Find latest release tag |
| 25 | + id: get_release |
| 26 | + run: | |
| 27 | + tag=$(gh release list --limit 1 --json tagName -q '.[0].tagName') |
| 28 | + echo "Found latest release: $tag" |
| 29 | + echo "tag=$tag" >> "$GITHUB_OUTPUT" |
| 30 | + env: |
| 31 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
34 | 32 |
|
35 |
| - - name: Upload zip files to latest release |
36 |
| - run: | |
37 |
| - for file in zip_outputs/*.zip; do |
38 |
| - gh release upload "${{ steps.get_release.outputs.tag }}" "$file" --clobber |
39 |
| - gh release upload "latest" "$file" --clobber || true |
40 |
| - done |
41 |
| - env: |
42 |
| - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + - name: Upload zip files to latest release |
| 34 | + run: | |
| 35 | + for file in zip_outputs/*.zip; do |
| 36 | + gh release upload "${{ steps.get_release.outputs.tag }}" "$file" --clobber |
| 37 | + done |
| 38 | + env: |
| 39 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments