File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 52
52
uses : actions/download-artifact@v2
53
53
with :
54
54
name : specification
55
+ - name : Parse changelog
56
+ id : changelog
57
+ run : |
58
+ version="$(cat ${{ env.FILE_NAME }} | grep -Po '(?<=version:\s.)[a-zA-Z0-9.]*(?=.$)')"
59
+ commit="$(cat ${{ env.FILE_NAME }} | grep -Pzo "(?<=$version:\s>\n)[\s\S]*?[\r\n]{2}" | tr -s ' ')"
60
+ commit="${commit//'%'/'%25'}"
61
+ commit="${commit//$'\n'/'%0A'}"
62
+ commit="${commit//$'\r'/'%0D'}"
63
+ echo "::set-output name=version::$version"
64
+ echo "::set-output name=commit::$commit"
55
65
- name : Setup java
56
66
uses : actions/setup-java@v1
57
67
with :
73
83
if [ -z "$(git status -uno --porcelain)" ]; then
74
84
echo "::set-output name=push::false"
75
85
else
76
- git commit -m "Generate SDK " -a
86
+ git commit -m "${{ steps.changelog.outputs.commit }} " -a
77
87
echo "::set-output name=push::true"
78
88
fi
79
89
shell : bash
@@ -90,10 +100,9 @@ jobs:
90
100
env :
91
101
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92
102
with :
93
- tag_name : v1.0.${{ github.run_number }}
94
- release_name : Release v1.0.${{ github.run_number }}
95
- body : |
96
- Generated automatically
103
+ tag_name : v${{ steps.changelog.outputs.version }}
104
+ release_name : Release v${{ steps.changelog.outputs.version }}
105
+ body : ${{ steps.changelog.outputs.commit }}
97
106
draft : true
98
107
prerelease : false
99
108
- name : Delete artifacts
You can’t perform that action at this time.
0 commit comments