-
Notifications
You must be signed in to change notification settings - Fork 9
48 lines (39 loc) · 1.11 KB
/
create-artifacts.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Zip and Publish Subfolders
on:
release:
types: [published]
jobs:
zip-and-publish:
runs-on: ubuntu-latest
outputs:
files: ${{ steps.list_zip_files.outputs.files }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create zip files for each subfolder
run: |
for dir in $(find . -mindepth 1 -maxdepth 1 -type d); do
zip -r "${dir##*/}.zip" "$dir"
done
- name: List zip files
id: list_zip_files
run: |
files=$(ls *.zip | jq -R . | jq -s . | tr -d '\n' | tr -d ' ')
echo "files=$files" >> $GITHUB_OUTPUT
shell: bash
- name: Debug output
run: echo "Files $files"
upload-artifacts:
needs: zip-and-publish
runs-on: ubuntu-latest
strategy:
matrix:
file: ${{ fromJson(needs.zip-and-publish.outputs.files) }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.file }}
path: ${{ matrix.file }}