-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (42 loc) · 1.27 KB
/
generate-archives.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
49
50
51
52
name: Archive generation
on:
release:
types: [created]
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
read_batches:
runs-on: ubuntu-latest
outputs:
batches: ${{ steps.read_batches.outputs.batches }}
steps:
- name: Checkout self
uses: actions/checkout@v4
- name: Read study-batches.txt
id: read_batches
run: |
BATCHES=$(printf "\"%s\"," $(cat study-batches.txt) | sed "s/^/[/;s/,$/]/")
echo "batches=$BATCHES" >> $GITHUB_OUTPUT
- name: Upload study-batches.txt
env:
GITHUB_TOKEN: ${{ github.token }}
tag: ${{ github.ref_name }}
run: |
gh release upload "$tag" study-batches.txt
main:
runs-on: ubuntu-latest
needs: read_batches
strategy:
matrix:
batch: ${{ fromJson(needs.read_batches.outputs.batches) }}
steps:
- name: Checkout self
uses: actions/checkout@v4
- name: zip directory
run: zip -r ${{ matrix.batch }}.zip ${{ matrix.batch }}
- name: Upload .zip
env:
GITHUB_TOKEN: ${{ github.token }}
tag: ${{ github.ref_name }}
run: |
gh release upload "$tag" ${{ matrix.batch }}.zip