-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.26 KB
/
release-github-actions.yml
File metadata and controls
43 lines (37 loc) · 1.26 KB
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
name: Release - Github Actions
on:
push:
branches:
- develop
jobs:
list-of-action-to-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Display info
run: |
echo "Github event ref branch : ${{ github.event.ref }}"
echo "Github actor : $GITHUB_ACTOR"
echo "Github branch : ${GITHUB_REF#refs/heads/}"
- name: Fetch tags
run: |
git fetch --tag
- name: Create tags
run: |
versions=$(cat ./release.txt)
while read n; do
echo "Name $n"
if grep -q -w $n <<< $(git tag -l); then
echo "$n already exist"
else
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" \
https://api.github.com/repos/grasdouble/github-action/releases \
-d '{"tag_name":"'"${n}"'","target_commitish":"develop","name":"'"${n}"'","body":"'"$(echo Release ${n})"'","draft":false,"prerelease":false,"generate_release_notes":false}'
fi
done <<< "$versions"