-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (45 loc) · 1.35 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
45
46
47
48
49
50
51
name: Create Release on Version Update
on:
push:
paths:
- VERSION
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run catalog script
id: run_script
run: |
# Execute the script and save the output
if [ -x scripts/GetCatalog.md ]; then
./scripts/GetCatalog.md > release_notes.md
else
echo "scripts/GetCatalog.md is not executable or not found"
exit 1
fi
- name: Create tag
id: create_tag
run: |
# Generate a new tag based on the version
TAG_NAME=$(cat VERSION)
git tag $TAG_NAME
git push origin $TAG_NAME
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
- name: Output release notes
id: output_release_notes
run: |
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
cat release_notes.md >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create release
uses: actions/create-release@v1
with:
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.TAG_NAME }} # No "Release" prefix here
body: ${{ env.RELEASE_NOTES }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}