-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (51 loc) · 1.7 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
52
53
54
55
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
jobs:
release:
name: Create Release
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Get Version Info
id: get_tag
shell: bash
run: |
SUBJECT=$(/usr/bin/git tag -l ${GITHUB_REF#refs/tags/} --format='%(subject)')
BODY=$(/usr/bin/git tag -l ${GITHUB_REF#refs/tags/} --format='%(body)' | sed '/-----BEGIN PGP SIGNATURE-----/,$d')
echo "SUBJECT=$SUBJECT"
echo "BODY=$BODY"
echo 'tag_subject<<EOS' >> $GITHUB_ENV
echo "$SUBJECT" >> $GITHUB_ENV
echo 'EOS' >> $GITHUB_ENV
echo 'tag_body<<EOB' >> $GITHUB_ENV
echo "$BODY" >> $GITHUB_ENV
echo 'EOB' >> $GITHUB_ENV
echo "tag_version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "version_num=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Get Changelog Content
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ env.version_num }}
path: ./CHANGELOG.md
- name: Publish Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.tag_version }}
release_name: ${{ env.tag_subject }}
body: |
${{ env.tag_body }}
## Changelog
${{ steps.changelog_reader.outputs.changes }}
draft: false
prerelease: false