@@ -107,9 +107,9 @@ jobs:
107107 previousTag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)
108108 lastTag=$(git describe --abbrev=0 --tags)
109109 echo "previousTag:$previousTag ~ lastTag:$lastTag"
110- log=$(git log $previousTag..$lastTag --pretty=format:'- %cd ** %an** : %s' --date=format:'%Y-%m-%d %H:%M:%S')
110+ log=$(git log $previousTag..$lastTag --pretty=format:'- %cd %an: %s\n ' --date=format:'%Y-%m-%d %H:%M:%S')
111111 echo "$log"
112- echo "::set-output name=log::$log"
112+ echo "::set-output name=log::" $log" "
113113
114114 # 显示信息
115115 - name : Show info
@@ -118,10 +118,10 @@ jobs:
118118 echo '${{ steps.Core-path.outputs.path }}' # Core aar路径
119119 echo '${{ steps.Helper-path.outputs.path }}' # Helper aar路径
120120 echo '${{ steps.EpoxyHelper-path.outputs.path }}' # EpoxyHelper aar路径
121- echo '${{ steps.apk-path.outputs.path }}' # apk路径
121+ echo '${{ steps.apk-path.outputs.path }}'
122122 echo '${{ steps.apk-info.outputs.result }}' # get apk info success or failure
123- echo '${{ steps.time.outputs.time }}' # time
124- echo '${{ steps.git-log.outputs.log }}' # git log
123+ echo '${{ steps.time.outputs.time }}'
124+ echo '${{ steps.git-log.outputs.log }}'
125125 echo '${{ steps.apk-info.outputs.application-name }}'
126126 echo '${{ steps.apk-info.outputs.application-id }}'
127127 echo '${{ steps.apk-info.outputs.version-code }}'
@@ -146,13 +146,26 @@ jobs:
146146 payload : ' {"msgtype": "text", "text": {"content": "版本更新: ${{ steps.apk-info.outputs.application-name }}-版本号: ${{ steps.apk-info.outputs.version-name }} \n 编译时间: ${{ steps.time.outputs.time }} \n 距上个正式版的更新记录: \n${{ steps.git-log.outputs.log }}"}}'
147147 headers : ' {"Content-Type": "application/json"}'
148148
149- # 创建Release
149+ # 创建Changelog文件 triggered by git tag push,
150+ - name : Generate Changelog
151+ if : startsWith(github.ref, 'refs/tags/')
152+ run : |
153+ echo -e '${{ steps.git-log.outputs.log }}' > Release.txt
154+
155+ # Cat Changelog triggered by git tag push
156+ - name : Cat Changelog
157+ if : startsWith(github.ref, 'refs/tags/')
158+ run : |
159+ cat Release.txt
160+
161+ # 创建Release triggered by git tag push,
150162 # https://github.com/marketplace/actions/gh-release
151163 - name : Release
152164 uses : softprops/action-gh-release@v1
153165 if : startsWith(github.ref, 'refs/tags/')
154166 with :
155- body : ${{ steps.git-log.outputs.log }}
167+ body_path : Release.txt
168+ draft : true
156169 files : |
157170 ${{ steps.apk-path.outputs.path }}
158171 ${{ steps.Core-path.outputs.path }}
0 commit comments