-
Notifications
You must be signed in to change notification settings - Fork 112
44 lines (40 loc) · 1.11 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
42
43
44
name: release
on:
push:
branches:
- main
paths:
- meetings/**
jobs:
build:
runs-on: ubuntu-latest
steps:
- id: files
name: get changed files
uses: jitterbit/get-changed-files@v1
with:
format: 'json'
- run: |
readarray -t added_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added }}')"
for added_file in "${added_files[@]}"; do
if [[ ${added_file} == meetings/* ]]
then
tag=$(echo "${added_file}" | grep -oP '(?<=meetings/)[^\./]+')
echo "tag=${tag}" >> "$GITHUB_ENV" # set GH env var so other action can access it
echo tag set to "${tag}"
break
fi
done
- name: checkout
uses: actions/checkout@v4
- name: release
run: |
git fetch --depth=1 --tags
if [[ $(git tag -l "${{env.tag}}") ]]
then
echo "release exists; skipping"
else
gh release create "${{env.tag}}"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}