Skip to content

Commit d1fa6e6

Browse files
committed
Fix duplicate release asset file names
1 parent 005c751 commit d1fa6e6

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

.github/workflows/build-installers.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,19 @@ jobs:
2525
- id: build
2626
name: Build
2727
run: mvn --batch-mode package --file pom.xml
28+
- id: replace-filename-spaces
29+
name: Replace spaces in file name with underscores
30+
shell: pwsh
31+
run: |
32+
Get-ChildItem target/installer | Rename-Item -NewName { $_.name -Replace " ","_" }
2833
- id: upload-installer
2934
name: Upload installer
3035
uses: actions/upload-artifact@v4
3136
with:
3237
path: ./target/installer/*.msi
3338
name: installer-windows
3439
if-no-files-found: error
40+
retention-days: 7
3541

3642
build-linux-installer:
3743
name: Build installer for Linux
@@ -57,6 +63,7 @@ jobs:
5763
path: ./target/installer/*
5864
name: installer-linux
5965
if-no-files-found: error
66+
retention-days: 7
6067

6168
build-mac-arm-installer:
6269
name: Build installer for ARM64 macOS
@@ -75,13 +82,23 @@ jobs:
7582
- id: build
7683
name: Build
7784
run: mvn --batch-mode package --file pom.xml
85+
- id: add-arch-suffix
86+
name: Add architecture file name suffix
87+
shell: bash
88+
run: |
89+
for file in target/installer/*.dmg; do
90+
before_ext="${file%.*}"
91+
replaced_spaces="${before_ext// /_}"
92+
mv "$file" "${replaced_spaces}_arm64.dmg"
93+
done
7894
- id: upload-installer
7995
name: Upload installer
8096
uses: actions/upload-artifact@v4
8197
with:
82-
path: ./target/installer/*
98+
path: ./target/installer/*.dmg
8399
name: installer-macos-arm64
84100
if-no-files-found: error
101+
retention-days: 7
85102

86103
build-mac-x64-installer:
87104
name: Build installer for x64 macOS
@@ -100,13 +117,23 @@ jobs:
100117
- id: build
101118
name: Build
102119
run: mvn --batch-mode package --file pom.xml
120+
- id: add-arch-suffix
121+
name: Add architecture file name suffix
122+
shell: bash
123+
run: |
124+
for file in target/installer/*.dmg; do
125+
before_ext="${file%.*}"
126+
replaced_spaces="${before_ext// /_}"
127+
mv "$file" "${replaced_spaces}_x64.dmg"
128+
done
103129
- id: upload-installer
104130
name: Upload installer
105131
uses: actions/upload-artifact@v4
106132
with:
107133
path: ./target/installer/*
108134
name: installer-macos-x64
109135
if-no-files-found: error
136+
retention-days: 7
110137

111138
draft-release:
112139
name: Draft a new release

0 commit comments

Comments
 (0)