1
1
name : ReleaseFlow
2
2
3
3
on :
4
- workflow_dispatch :
5
- inputs :
6
- version :
7
- required : true
8
-
4
+ pull_request :
5
+ branches : [master]
6
+ types : [closed]
9
7
jobs :
8
+ version :
9
+ if : github.event.pull_request.merged == true
10
+ runs-on : ubuntu-latest
11
+ outputs :
12
+ version : ${{ steps.semvers.outputs.minor }}
13
+ changelog : ${{ steps.Changelog.outputs.changelog }}
14
+ steps :
15
+ - uses : docker://agilepathway/pull-request-label-checker:latest
16
+ with :
17
+ one_of : release
18
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
19
+
20
+ - name : ' Checkout repo'
21
+ uses : actions/checkout@v2
22
+
23
+ - name : ' Update tag'
24
+ run : git fetch --prune --unshallow --tags
25
+
26
+ - name : ' Get latest tag'
27
+ id : latesttag
28
+ uses : pozetroninc/github-action-get-latest-release@master
29
+ with :
30
+ repository : ${{ github.repository }}
31
+
32
+ - name : ' Get next version'
33
+ id : semvers
34
+ uses : " WyriHaximus/github-action-next-semvers@v1"
35
+ with :
36
+ version : ${{ steps.latesttag.outputs.release }}
37
+
38
+ - name : ' Create changelog'
39
+ id : Changelog
40
+ run : |
41
+ changelog="${{github.event.pull_request.body}}"
42
+ changelog="${changelog//'%'/'%25'}"
43
+ changelog="${changelog//$'\n'/'%0A'}"
44
+ changelog="${changelog//$'\r'/'%0D'}"
45
+ echo "::set-output name=changelog::$changelog"
10
46
build :
11
47
runs-on : windows-2019
12
48
strategy :
36
72
37
73
release :
38
74
runs-on : ubuntu-latest
39
- needs : build
75
+ needs : [ build, version]
40
76
steps :
41
77
- name : Download artifact
42
78
uses : actions/download-artifact@v3
59
95
token : ${{ secrets.GITHUB_TOKEN }}
60
96
body : |
61
97
Please join our Discord server for more information: [https://discord.gg/mBa4f2K](https://discord.gg/mBa4f2K)
62
-
98
+
99
+ **Changelog**:
100
+ ${{needs.version.outputs.changelog}}
63
101
Discord :
64
102
runs-on : ubuntu-latest
65
103
needs : release
@@ -75,7 +113,10 @@ jobs:
75
113
nodetail : true
76
114
description : |
77
115
Version `TBS-${{github.event.inputs.version}}`
78
- Click [here](https://github.com/Erol444/TravianBotSharp/releases/tag/${{github.event.inputs.version}}) to download!
116
+ Click [here](https://github.com/Erol444/TravianBotSharp/releases/tag/${{needs.version.outputs.version}}) to download!
117
+
118
+ **Changelog**:
119
+ ${{needs.version.outputs.changelog}}
79
120
Clear :
80
121
runs-on : ubuntu-latest
81
122
needs : release
0 commit comments