Skip to content

Commit 12d4af5

Browse files
committed
Upload all discovered Windows installers in CI
1 parent c50e071 commit 12d4af5

2 files changed

Lines changed: 28 additions & 24 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,22 @@ jobs:
7878
if: matrix.os == 'windows-2022'
7979
shell: bash
8080
run: |
81-
shopt -s nullglob
82-
src=(
83-
cross-platform/src-tauri/target/release/bundle/nsis/*.exe
84-
cross-platform/src-tauri/target/release/bundle/msi/*.msi
81+
shopt -s nullglob globstar
82+
installer_candidates=(
83+
cross-platform/src-tauri/target/release/bundle/nsis/**/*.exe
84+
cross-platform/src-tauri/target/release/bundle/msi/**/*.msi
85+
cross-platform/src-tauri/target/release/bundle/wix/**/*.msi
8586
)
86-
if [ ${#src[@]} -eq 0 ]; then
87-
echo "No Windows installer found (expected NSIS .exe or MSI .msi)"
87+
if [ ${#installer_candidates[@]} -eq 0 ]; then
88+
echo "No Windows installer artifacts found under cross-platform/src-tauri/target/release/bundle/{nsis,msi,wix}"
8889
exit 1
8990
fi
90-
installer_path="${src[0]}"
91-
installer_ext="${installer_path##*.}"
92-
installer_name="PinStick-${APP_VERSION}-windows.${installer_ext}"
93-
cp "$installer_path" "$installer_name"
94-
printf "WINDOWS_INSTALLER=%s\n" "$installer_name" >> "$GITHUB_ENV"
91+
artifact_dir="PinStick-${APP_VERSION}-windows"
92+
mkdir -p "$artifact_dir"
93+
for installer_path in "${installer_candidates[@]}"; do
94+
cp "$installer_path" "$artifact_dir/"
95+
done
96+
printf "WINDOWS_ARTIFACT_DIR=%s\n" "$artifact_dir" >> "$GITHUB_ENV"
9597
9698
- name: Collect Linux AppImage
9799
if: matrix.os == 'ubuntu-22.04'
@@ -117,7 +119,7 @@ jobs:
117119
uses: actions/upload-artifact@v4
118120
with:
119121
name: PinStick-windows
120-
path: ${{ env.WINDOWS_INSTALLER }}
122+
path: ${{ env.WINDOWS_ARTIFACT_DIR }}
121123
if-no-files-found: error
122124

123125
- name: Upload Linux artifact

.github/workflows/prerelease.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,22 @@ jobs:
8585
if: matrix.os == 'windows-2022'
8686
shell: bash
8787
run: |
88-
shopt -s nullglob
89-
src=(
90-
cross-platform/src-tauri/target/release/bundle/nsis/*.exe
91-
cross-platform/src-tauri/target/release/bundle/msi/*.msi
88+
shopt -s nullglob globstar
89+
installer_candidates=(
90+
cross-platform/src-tauri/target/release/bundle/nsis/**/*.exe
91+
cross-platform/src-tauri/target/release/bundle/msi/**/*.msi
92+
cross-platform/src-tauri/target/release/bundle/wix/**/*.msi
9293
)
93-
if [ ${#src[@]} -eq 0 ]; then
94-
echo "No Windows installer found (expected NSIS .exe or MSI .msi)"
94+
if [ ${#installer_candidates[@]} -eq 0 ]; then
95+
echo "No Windows installer artifacts found under cross-platform/src-tauri/target/release/bundle/{nsis,msi,wix}"
9596
exit 1
9697
fi
97-
installer_path="${src[0]}"
98-
installer_ext="${installer_path##*.}"
99-
installer_name="PinStick-${APP_VERSION}-windows.${installer_ext}"
100-
cp "$installer_path" "$installer_name"
101-
printf "WINDOWS_INSTALLER=%s\n" "$installer_name" >> "$GITHUB_ENV"
98+
artifact_dir="PinStick-${APP_VERSION}-windows"
99+
mkdir -p "$artifact_dir"
100+
for installer_path in "${installer_candidates[@]}"; do
101+
cp "$installer_path" "$artifact_dir/"
102+
done
103+
printf "WINDOWS_ARTIFACT_DIR=%s\n" "$artifact_dir" >> "$GITHUB_ENV"
102104
103105
- name: Collect Linux AppImage
104106
if: matrix.os == 'ubuntu-22.04'
@@ -124,7 +126,7 @@ jobs:
124126
uses: actions/upload-artifact@v4
125127
with:
126128
name: PinStick-windows
127-
path: ${{ env.WINDOWS_INSTALLER }}
129+
path: ${{ env.WINDOWS_ARTIFACT_DIR }}
128130
if-no-files-found: error
129131

130132
- name: Upload Linux artifact

0 commit comments

Comments
 (0)