6
6
7
7
jobs :
8
8
9
+ read_version :
10
+ runs-on : ubuntu-latest
11
+ outputs :
12
+ version : ${{ steps.get_content.outputs.version }}
13
+ steps :
14
+ - name : Read version file
15
+ id : get_content
16
+ run : |
17
+ cd ${{runner.workspace}}/potku
18
+ echo "version=$(awk 'NR==1' version.txt)" >> $GITHUB_OUTPUT
19
+
9
20
package_windows :
10
21
runs-on : windows-latest
22
+ needs : read_version
11
23
defaults :
12
24
run :
13
25
shell : cmd
68
80
69
81
package_linux :
70
82
runs-on : ubuntu-latest
83
+ needs : read_version
71
84
steps :
72
85
- name : Checkout repository
73
86
uses : actions/checkout@v4
@@ -120,11 +133,12 @@ jobs:
120
133
- name : Archive Linux release
121
134
uses : actions/upload-artifact@v4
122
135
with :
123
- name : Potku-Linux-${{ steps.get_content .outputs.version }}
136
+ name : Potku-Linux-${{ needs.read_version .outputs.version }}
124
137
path : ${{runner.workspace}}/potku/dist/
125
138
126
139
package_macos :
127
140
runs-on : macos-latest
141
+ needs : read_version
128
142
steps :
129
143
- name : Checkout repository
130
144
uses : actions/checkout@v4
@@ -181,20 +195,15 @@ jobs:
181
195
path : ${{runner.workspace}}/potku/dist
182
196
183
197
create_release :
184
- needs : [package_windows, package_linux, package_macos]
198
+ needs : [read_version, package_windows, package_linux, package_macos]
185
199
runs-on : ubuntu-latest
186
200
steps :
187
201
- name : Git checkout
188
202
uses : actions/checkout@v4
189
- - name : Read version file
190
- id : get_content
191
- run : |
192
- cd ${{runner.workspace}}/potku
193
- echo "version=$(awk 'NR==1' version.txt)" >> $GITHUB_OUTPUT
194
203
- name : Check for pre-release
195
204
id : pre_release
196
205
run : |
197
- if [[ ${{ steps.get_content .outputs.version }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
206
+ if [[ ${{ needs.read_version .outputs.version }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
198
207
echo "pre_release=false" >> $GITHUB_OUTPUT
199
208
else
200
209
echo "pre_release=true" >> $GITHUB_OUTPUT
@@ -205,7 +214,7 @@ jobs:
205
214
- name : Download Windows release artifact
206
215
uses : dawidd6/action-download-artifact@v9
207
216
with :
208
- name : Potku-Windows
217
+ name : Potku-Windows-${{ needs.read_version.outputs.version }}.zip }}
209
218
workflow : version_bump.yml
210
219
path : ${{runner.workspace}}/potku/artifact
211
220
check_artifacts : true
@@ -214,7 +223,7 @@ jobs:
214
223
- name : Download Linux release artifact
215
224
uses : dawidd6/action-download-artifact@v9
216
225
with :
217
- name : Potku-Linux
226
+ name : Potku-Linux-${{ needs.read_version.outputs.version }}
218
227
workflow : version_bump.yml
219
228
path : ${{runner.workspace}}/potku/artifact
220
229
check_artifacts : true
@@ -223,7 +232,7 @@ jobs:
223
232
- name : Download macOS release artifact
224
233
uses : dawidd6/action-download-artifact@v9
225
234
with :
226
- name : Potku-macOS
235
+ name : Potku-macOS-${{ needs.read_version.outputs.version }}
227
236
workflow : version_bump.yml
228
237
path : ${{runner.workspace}}/potku/artifact
229
238
check_artifacts : true
@@ -234,24 +243,24 @@ jobs:
234
243
uses : marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
235
244
with :
236
245
repo_token : " ${{ secrets.GITHUB_TOKEN }}"
237
- automatic_release_tag : ${{ steps.get_content .outputs.version }}
238
- title : Potku ${{ steps.get_content .outputs.version }}
246
+ automatic_release_tag : ${{ needs.read_version .outputs.version }}.zip }}
247
+ title : Potku ${{ needs.read_version .outputs.version }}.zip }}
239
248
draft : false
240
249
prerelease : true
241
250
files : |
242
- ${{runner.workspace}}/potku/artifact/Potku-Linux-${{ steps.get_content .outputs.version }}.zip
243
- ${{runner.workspace}}/potku/artifact/Potku-Windows-${{ steps.get_content .outputs.version }}.zip
244
- ${{runner.workspace}}/potku/artifact/Potku-macOS-${{ steps.get_content .outputs.version }}.zip
251
+ ${{runner.workspace}}/potku/artifact/Potku-Linux-${{ needs.read_version .outputs.version }}.zip
252
+ ${{runner.workspace}}/potku/artifact/Potku-Windows-${{ needs.read_version .outputs.version }}.zip
253
+ ${{runner.workspace}}/potku/artifact/Potku-macOS-${{ needs.read_version .outputs.version }}.zip
245
254
- name : Create release
246
255
if : steps.pre_release.outputs.pre_release == 'false'
247
256
uses : marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
248
257
with :
249
258
repo_token : " ${{ secrets.GITHUB_TOKEN }}"
250
- automatic_release_tag : ${{ steps.get_content .outputs.version }}
259
+ automatic_release_tag : ${{ needs.read_version .outputs.version }}.zip }}
251
260
title : Potku ${{ steps.get_content.outputs.version }}
252
261
draft : true
253
262
prerelease : false
254
263
files : |
255
- ${{runner.workspace}}/potku/artifact/Potku-Linux-${{ steps.get_content .outputs.version }}.zip
256
- ${{runner.workspace}}/potku/artifact/Potku-Windows-${{ steps.get_content .outputs.version }}.zip
257
- ${{runner.workspace}}/potku/artifact/Potku-macOS-${{ steps.get_content .outputs.version }}.zip
264
+ ${{runner.workspace}}/potku/artifact/Potku-Linux-${{ needs.read_version .outputs.version }}.zip }}.zip
265
+ ${{runner.workspace}}/potku/artifact/Potku-Windows-${{ needs.read_version .outputs.version }}.zip }}.zip
266
+ ${{runner.workspace}}/potku/artifact/Potku-macOS-${{ needs.read_version .outputs.version }}.zip }}.zip
0 commit comments