-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (36 loc) · 1.09 KB
/
release.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
name: Upload Release
on:
push:
tags:
- "v*"
jobs:
job:
name: Upload Release Assets
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Zip source files
run: |
set -x
yq() {
docker run --rm -i -v "${PWD}":/workdir mikefarah/yq:latest "$@"
}
mkdir -p zip
for foo in $(yq e '.notes.*.* | path | join(".")' documents.yml) # enumerate yaml paths
do
export SRC=$(yq e ".$foo.path" documents.yml)
export DEST="$PWD/zip/$(yq e ".$foo.zip" documents.yml)"
(cd "$SRC" && zip -r "$DEST" .)
done
- name: Upload zips
run: | # from https://gist.github.com/superbrothers/af84a2f8af394a62352e06537a640746
set -x
assets=()
for asset in zip/*.zip; do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create -d "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}