@@ -3,171 +3,178 @@ name: Release
3
3
on :
4
4
push :
5
5
branches :
6
- - main
7
- - master
8
- - develop
6
+ - godot3
7
+ - godot3-develop
9
8
10
9
# Allows you to run this workflow manually from the Actions tab
11
10
workflow_dispatch :
12
11
13
12
permissions :
14
- contents : write
13
+ contents : write
15
14
16
15
env :
17
- ADDON_NAME : godot-playfab
18
- ITCH_USERNAME : structed
19
- ITCH_GAME_ID : godot-playfab
20
- ASSET_LIB_USERNAME : structed
21
- ASSET_LIB_ASSET_ID : 1321
16
+ ADDON_NAME : godot-playfab
17
+ ITCH_USERNAME : structed
18
+ ITCH_GAME_ID : godot-playfab
19
+ ASSET_LIB_USERNAME : structed
20
+ ASSET_LIB_ASSET_ID : 7458
22
21
23
22
jobs :
24
- prerelease :
25
- if : " github.event.head_commit.message != 'Release preparation: storing Version and Changelog'"
26
- name : Preparing release
27
- runs-on : ubuntu-latest
28
- outputs :
29
- version : ${{ steps.calculate_version.outputs.new_version }}
30
- tag : ${{ steps.calculate_version.outputs.new_tag }}
31
- changelog : ${{ steps.calculate_version.outputs.changelog }}
32
- steps :
33
- - uses : actions/checkout@v3
34
- with :
35
- fetch-depth : 0
36
- token : ${{ secrets.PAT }}
37
-
38
- - name : Calculate version
39
- id : calculate_version
40
- uses :
mathieudutour/[email protected]
41
- with :
42
- tag_prefix : " "
43
- github_token : ${{ secrets.PAT }}
44
- dry_run : true
45
- default_bump : false
46
- custom_release_rules : |
47
- "fix:patch:Bug Fixes,hotfix:patch:Bug Fixes,feature:minor:Features,change:minor:Changes,breaking:major:Breaking Changes,major:major:Major Changes"
48
-
49
- - name : " Write changelog"
50
- run : |
51
- CHANGELOG=""
52
- if [ -e addons/${{env.ADDON_NAME}}/CHANGELOG.md ]
53
- then
54
- CHANGELOG=$(cat addons/${{env.ADDON_NAME}}/CHANGELOG.md)
55
- fi
56
- echo -e "${{steps.calculate_version.outputs.changelog}}\n\n${CHANGELOG}" > addons/${{env.ADDON_NAME}}/CHANGELOG.md
57
- if : github.ref == 'refs/heads/main' && steps.calculate_version.outputs.new_version != ''
58
-
59
- - name : " Update version in plugin.cfg"
60
- run : |
61
- sed -i -re 's/version=".+$/version="${{ steps.calculate_version.outputs.new_version }}"/gi' addons/${{env.ADDON_NAME}}/plugin.cfg
62
- if : steps.calculate_version.outputs.new_version != ''
63
-
64
- - name : " Commit"
65
-
66
- with :
67
- message : ' Release preparation: storing Version and Changelog'
68
- push : true
69
- if : github.ref == 'refs/heads/main' && steps.calculate_version.outputs.new_version != ''
70
-
71
- release :
72
- # Create release only after the version was bumped and release notes added:
73
- if : " github.event.head_commit.message == 'Release preparation: storing Version and Changelog'"
74
- runs-on : ubuntu-latest
75
-
76
- steps :
77
-
78
- - uses : actions/checkout@v3
79
- with :
80
- fetch-depth : 0
81
- token : ${{ secrets.GITHUB_TOKEN }}
82
-
83
- - name : Create version
84
- id : create_version
85
- uses :
mathieudutour/[email protected]
86
- with :
87
- tag_prefix : " "
88
- dry_run : ${{ github.ref_name != 'main' }}
89
- github_token : ${{ secrets.GITHUB_TOKEN }}
90
- default_bump : false
91
-
92
- - name : Upload artifact
93
- uses : actions/upload-artifact@v3
94
- with :
95
- name : ${{env.ADDON_NAME}}-${{ steps.create_version.outputs.new_tag }}
96
- path : addons/${{env.ADDON_NAME}}/
97
- if-no-files-found : error # 'warn' or 'ignore' are also available, defaults to `warn`
98
- if : steps.create_version.outputs.new_version != ''
99
-
100
- - name : Create Release
101
-
102
- with :
103
- name : ${{ steps.create_version.outputs.new_tag }}
104
- body : ${{ steps.create_version.outputs.changelog }}
105
- draft : false
106
- prerelease : ${{ github.ref_name != 'main' }}
107
- latest : ${{ github.ref_name != 'main' }}
108
- artifacts : " "
109
- replacesArtifacts : false
110
- generateReleaseNotes : true
111
- token : ${{ secrets.GITHUB_TOKEN }}
112
- tag : ${{ steps.create_version.outputs.new_tag }}
113
- if : steps.create_version.outputs.new_version != ''
114
-
115
- itch :
116
- if : " github.ref == 'refs/heads/main' && github.event.head_commit.message == 'Release preparation: storing Version and Changelog'"
117
- runs-on : ubuntu-latest
118
- needs : release
119
-
120
- steps :
121
-
122
- - name : Calculate version
123
- id : calculate_version
124
- uses :
mathieudutour/[email protected]
125
- with :
126
- tag_prefix : " v"
127
- github_token : ${{ secrets.PAT }}
128
- dry_run : true
129
- default_bump : false
130
-
131
- # Using https://github.com/KikimoraGames/itch-publish
132
- - uses : actions/download-artifact@v3
133
- with :
134
- name : ${{env.ADDON_NAME}}-${{ steps.calculate_version.outputs.previous_tag }}
135
- path : addons/${{env.ADDON_NAME}}/
136
-
137
- -
uses :
KikimoraGames/[email protected]
138
- with :
139
- butlerApiKey : ${{secrets.ITCHIO_SECRET}}
140
- gameData : .
141
- itchUsername : ${{env.ITCH_USERNAME}}
142
- itchGameId : ${{ env.ITCH_GAME_ID }}
143
- buildChannel : windows-mac-linux
144
- buildNumber : ${{ steps.calculate_version.outputs.previous_tag }}
145
-
146
- assetlib :
147
- if : " github.ref == 'refs/heads/main' && github.event.head_commit.message == 'Release preparation: storing Version and Changelog'"
148
- runs-on : ubuntu-latest
149
- needs : release
150
- name : Godot AssetLib
151
- steps :
152
-
153
- - uses : actions/checkout@v3
154
-
155
- - name : Calculate version
156
- id : calculate_version
157
- uses :
mathieudutour/[email protected]
158
- with :
159
- tag_prefix : " v"
160
- github_token : ${{ secrets.PAT }}
161
- dry_run : true
162
- default_bump : false
163
-
164
- - name : Set Version
165
- run : |
166
- echo "version=${{ steps.calculate_version.outputs.previous_tag }}" >> $GITHUB_ENV
167
-
168
- - name : Godot Asset Lib
169
- uses :
deep-entertainment/[email protected]
170
- with :
171
- username : ${{ env.ASSET_LIB_USERNAME }}
172
- password : ${{ secrets.ASSET_LIB_PASSWORD }}
173
- assetId : ${{ env.ASSET_LIB_ASSET_ID }}
23
+ prerelease :
24
+ if : " github.event.head_commit.message != 'Release preparation: storing Version and Changelog'"
25
+ name : Preparing release
26
+ runs-on : ubuntu-latest
27
+ outputs :
28
+ version : ${{ steps.calculate_version.outputs.new_version }}
29
+ tag : ${{ steps.calculate_version.outputs.new_tag }}
30
+ changelog : ${{ steps.calculate_version.outputs.changelog }}
31
+ steps :
32
+ - uses : actions/checkout@v3
33
+ with :
34
+ fetch-depth : 0
35
+ token : ${{ secrets.PAT }}
36
+
37
+ - name : Calculate version
38
+ id : calculate_version
39
+ uses :
mathieudutour/[email protected]
40
+ with :
41
+ tag_prefix : " "
42
+ github_token : ${{ secrets.PAT }}
43
+ dry_run : true
44
+ default_bump : false
45
+ release_branches : godot3
46
+ pre_release_branches : godot3-develop
47
+ custom_release_rules : |
48
+ "fix:patch:Bug Fixes,hotfix:patch:Bug Fixes,feature:minor:Features,change:minor:Changes,breaking:major:Breaking Changes,major:major:Major Changes"
49
+
50
+ - name : " Write changelog"
51
+ run : |
52
+ CHANGELOG=""
53
+ if [ -e addons/${{env.ADDON_NAME}}/CHANGELOG.md ]
54
+ then
55
+ CHANGELOG=$(cat addons/${{env.ADDON_NAME}}/CHANGELOG.md)
56
+ fi
57
+ echo -e "${{steps.calculate_version.outputs.changelog}}\n\n${CHANGELOG}" > addons/${{env.ADDON_NAME}}/CHANGELOG.md
58
+ if : github.ref == 'refs/heads/godot3' && steps.calculate_version.outputs.new_version != ''
59
+
60
+ - name : " Update version in plugin.cfg"
61
+ run : |
62
+ sed -i -re 's/version=".+$/version="${{ steps.calculate_version.outputs.new_version }}"/gi' addons/${{env.ADDON_NAME}}/plugin.cfg
63
+ if : steps.calculate_version.outputs.new_version != ''
64
+
65
+ - name : " Commit"
66
+
67
+ with :
68
+ message : ' Release preparation: storing Version and Changelog'
69
+ push : true
70
+ if : github.ref == 'refs/heads/godot3' && steps.calculate_version.outputs.new_version != ''
71
+
72
+ release :
73
+ # Create release only after the version was bumped and release notes added:
74
+ if : " github.event.head_commit.message == 'Release preparation: storing Version and Changelog'"
75
+ runs-on : ubuntu-latest
76
+
77
+ steps :
78
+
79
+ - uses : actions/checkout@v3
80
+ with :
81
+ fetch-depth : 0
82
+ token : ${{ secrets.GITHUB_TOKEN }}
83
+
84
+ - name : Create version
85
+ id : create_version
86
+ uses :
mathieudutour/[email protected]
87
+ with :
88
+ tag_prefix : " "
89
+ dry_run : ${{ github.ref_name != 'godot3' }}
90
+ github_token : ${{ secrets.GITHUB_TOKEN }}
91
+ default_bump : false
92
+ release_branches : godot3
93
+ pre_release_branches : godot3-develop
94
+
95
+ - name : Upload artifact
96
+ uses : actions/upload-artifact@v3
97
+ with :
98
+ name : ${{env.ADDON_NAME}}-${{ steps.create_version.outputs.new_tag }}
99
+ path : addons/${{env.ADDON_NAME}}/
100
+ if-no-files-found : error # 'warn' or 'ignore' are also available, defaults to `warn`
101
+ if : steps.create_version.outputs.new_version != ''
102
+
103
+ - name : Create Release
104
+
105
+ with :
106
+ name : ${{ steps.create_version.outputs.new_tag }}
107
+ body : ${{ steps.create_version.outputs.changelog }}
108
+ draft : false
109
+ prerelease : ${{ github.ref_name != 'godot3' }}
110
+ latest : ${{ github.ref_name != 'godot3' }}
111
+ artifacts : " "
112
+ replacesArtifacts : false
113
+ generateReleaseNotes : true
114
+ token : ${{ secrets.GITHUB_TOKEN }}
115
+ tag : ${{ steps.create_version.outputs.new_tag }}
116
+ if : steps.create_version.outputs.new_version != ''
117
+
118
+ itch :
119
+ if : " github.ref == 'refs/heads/godot3' && github.event.head_commit.message == 'Release preparation: storing Version and Changelog'"
120
+ runs-on : ubuntu-latest
121
+ needs : release
122
+
123
+ steps :
124
+
125
+ - name : Calculate version
126
+ id : calculate_version
127
+ uses :
mathieudutour/[email protected]
128
+ with :
129
+ tag_prefix : " v"
130
+ github_token : ${{ secrets.PAT }}
131
+ dry_run : true
132
+ default_bump : false
133
+ release_branches : godot3
134
+ pre_release_branches : godot3-develop
135
+
136
+ # Using https://github.com/KikimoraGames/itch-publish
137
+ - uses : actions/download-artifact@v3
138
+ with :
139
+ name : ${{env.ADDON_NAME}}-${{ steps.calculate_version.outputs.previous_tag }}
140
+ path : addons/${{env.ADDON_NAME}}/
141
+
142
+ -
uses :
KikimoraGames/[email protected]
143
+ with :
144
+ butlerApiKey : ${{secrets.ITCHIO_SECRET}}
145
+ gameData : .
146
+ itchUsername : ${{env.ITCH_USERNAME}}
147
+ itchGameId : ${{ env.ITCH_GAME_ID }}
148
+ buildChannel : windows-mac-linux
149
+ buildNumber : ${{ steps.calculate_version.outputs.previous_tag }}
150
+
151
+ assetlib :
152
+ if : " github.ref == 'refs/heads/godot3' && github.event.head_commit.message == 'Release preparation: storing Version and Changelog'"
153
+ runs-on : ubuntu-latest
154
+ needs : release
155
+ name : Godot AssetLib
156
+ steps :
157
+
158
+ - uses : actions/checkout@v3
159
+
160
+ - name : Calculate version
161
+ id : calculate_version
162
+ uses :
mathieudutour/[email protected]
163
+ with :
164
+ tag_prefix : " v"
165
+ github_token : ${{ secrets.PAT }}
166
+ dry_run : true
167
+ default_bump : false
168
+ release_branches : godot3
169
+ pre_release_branches : godot3-develop
170
+
171
+ - name : Set Version
172
+ run : |
173
+ echo "version=${{ steps.calculate_version.outputs.previous_tag }}" >> $GITHUB_ENV
174
+
175
+ - name : Godot Asset Lib
176
+ uses :
deep-entertainment/[email protected]
177
+ with :
178
+ username : ${{ env.ASSET_LIB_USERNAME }}
179
+ password : ${{ secrets.ASSET_LIB_PASSWORD }}
180
+ assetId : ${{ env.ASSET_LIB_ASSET_ID }}
0 commit comments