Skip to content

Commit df86e65

Browse files
committed
Trying to fix packaging action.
1 parent 5daf574 commit df86e65

File tree

1 file changed

+29
-20
lines changed

1 file changed

+29
-20
lines changed

.github/workflows/package_potku.yml

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,20 @@ on:
66

77
jobs:
88

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+
920
package_windows:
1021
runs-on: windows-latest
22+
needs: read_version
1123
defaults:
1224
run:
1325
shell: cmd
@@ -68,6 +80,7 @@ jobs:
6880

6981
package_linux:
7082
runs-on: ubuntu-latest
83+
needs: read_version
7184
steps:
7285
- name: Checkout repository
7386
uses: actions/checkout@v4
@@ -120,11 +133,12 @@ jobs:
120133
- name: Archive Linux release
121134
uses: actions/upload-artifact@v4
122135
with:
123-
name: Potku-Linux-${{ steps.get_content.outputs.version }}
136+
name: Potku-Linux-${{ needs.read_version.outputs.version }}
124137
path: ${{runner.workspace}}/potku/dist/
125138

126139
package_macos:
127140
runs-on: macos-latest
141+
needs: read_version
128142
steps:
129143
- name: Checkout repository
130144
uses: actions/checkout@v4
@@ -181,20 +195,15 @@ jobs:
181195
path: ${{runner.workspace}}/potku/dist
182196

183197
create_release:
184-
needs: [package_windows, package_linux, package_macos]
198+
needs: [read_version, package_windows, package_linux, package_macos]
185199
runs-on: ubuntu-latest
186200
steps:
187201
- name: Git checkout
188202
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
194203
- name: Check for pre-release
195204
id: pre_release
196205
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
198207
echo "pre_release=false" >> $GITHUB_OUTPUT
199208
else
200209
echo "pre_release=true" >> $GITHUB_OUTPUT
@@ -205,7 +214,7 @@ jobs:
205214
- name: Download Windows release artifact
206215
uses: dawidd6/action-download-artifact@v9
207216
with:
208-
name: Potku-Windows
217+
name: Potku-Windows-${{ needs.read_version.outputs.version }}.zip }}
209218
workflow: version_bump.yml
210219
path: ${{runner.workspace}}/potku/artifact
211220
check_artifacts: true
@@ -214,7 +223,7 @@ jobs:
214223
- name: Download Linux release artifact
215224
uses: dawidd6/action-download-artifact@v9
216225
with:
217-
name: Potku-Linux
226+
name: Potku-Linux-${{ needs.read_version.outputs.version }}
218227
workflow: version_bump.yml
219228
path: ${{runner.workspace}}/potku/artifact
220229
check_artifacts: true
@@ -223,7 +232,7 @@ jobs:
223232
- name: Download macOS release artifact
224233
uses: dawidd6/action-download-artifact@v9
225234
with:
226-
name: Potku-macOS
235+
name: Potku-macOS-${{ needs.read_version.outputs.version }}
227236
workflow: version_bump.yml
228237
path: ${{runner.workspace}}/potku/artifact
229238
check_artifacts: true
@@ -234,24 +243,24 @@ jobs:
234243
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
235244
with:
236245
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 }}
239248
draft: false
240249
prerelease: true
241250
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
245254
- name: Create release
246255
if: steps.pre_release.outputs.pre_release == 'false'
247256
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
248257
with:
249258
repo_token: "${{ secrets.GITHUB_TOKEN }}"
250-
automatic_release_tag: ${{ steps.get_content.outputs.version }}
259+
automatic_release_tag: ${{ needs.read_version.outputs.version }}.zip }}
251260
title: Potku ${{ steps.get_content.outputs.version }}
252261
draft: true
253262
prerelease: false
254263
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

Comments
 (0)