Skip to content

Commit a11d0ad

Browse files
authored
Merge pull request #7 from SillyLittleTech/codex/fix-windows-installer-not-found-error
CI: per-OS Tauri build, robust Windows artifact collection, add Windows icon
2 parents d090ed1 + e41b1b4 commit a11d0ad

3 files changed

Lines changed: 73 additions & 23 deletions

File tree

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

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,23 @@ jobs:
6262

6363
- name: Build cross-platform app
6464
working-directory: cross-platform
65-
run: npm run build -- --verbose
65+
shell: bash
66+
run: |
67+
case "${{ matrix.os }}" in
68+
windows-2022)
69+
npx tauri build --bundles nsis,msi --verbose
70+
;;
71+
ubuntu-22.04)
72+
npx tauri build --bundles appimage --verbose
73+
;;
74+
macos-14)
75+
npx tauri build --bundles app --verbose
76+
;;
77+
*)
78+
echo "Unsupported runner: ${{ matrix.os }}"
79+
exit 1
80+
;;
81+
esac
6682
6783
- name: Package macOS app bundle
6884
if: matrix.os == 'macos-14'
@@ -79,19 +95,27 @@ jobs:
7995
shell: bash
8096
run: |
8197
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
98+
release_dir="cross-platform/src-tauri/target/release"
99+
bundle_dir="$release_dir/bundle"
100+
msi_candidates=(
101+
"$bundle_dir"/**/*.msi
102+
)
103+
portable_candidates=(
104+
"$release_dir"/*.exe
85105
)
86-
if [ ${#installer_candidates[@]} -eq 0 ]; then
87-
echo "No Windows installer artifacts found under cross-platform/src-tauri/target/release/bundle/{nsis,msi,wix}"
88-
exit 1
89-
fi
90106
artifact_dir="PinStick-${APP_VERSION}-windows"
91107
mkdir -p "$artifact_dir"
92-
for installer_path in "${installer_candidates[@]}"; do
93-
cp "$installer_path" "$artifact_dir/"
94-
done
108+
if [ ${#msi_candidates[@]} -eq 0 ] || [ ${#portable_candidates[@]} -eq 0 ]; then
109+
echo "Expected MSI installer under $bundle_dir and portable EXE under $release_dir"
110+
if [ -d "$release_dir" ]; then
111+
find "$release_dir" -maxdepth 4 -type f | sort
112+
else
113+
echo "Release directory missing: $release_dir"
114+
fi
115+
exit 1
116+
fi
117+
cp "${msi_candidates[0]}" "$artifact_dir/PinStick-install.msi"
118+
cp "${portable_candidates[0]}" "$artifact_dir/PinStick-portable.exe"
95119
printf "WINDOWS_ARTIFACT_DIR=%s\n" "$artifact_dir" >> "$GITHUB_ENV"
96120
97121
- name: Collect Linux AppImage

.github/workflows/prerelease.yml

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,23 @@ jobs:
6969

7070
- name: Build cross-platform app
7171
working-directory: cross-platform
72-
run: npm run build -- --verbose
72+
shell: bash
73+
run: |
74+
case "${{ runner.os }}" in
75+
Windows)
76+
npm run tauri -- build --bundles nsis,msi --verbose
77+
;;
78+
Linux)
79+
npm run tauri -- build --bundles appimage --verbose
80+
;;
81+
macOS)
82+
npm run tauri -- build --bundles app --verbose
83+
;;
84+
*)
85+
echo "Unsupported runner OS: ${{ runner.os }}"
86+
exit 1
87+
;;
88+
esac
7389
7490
- name: Package macOS app bundle
7591
if: matrix.os == 'macos-14'
@@ -86,19 +102,27 @@ jobs:
86102
shell: bash
87103
run: |
88104
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
105+
release_dir="cross-platform/src-tauri/target/release"
106+
bundle_dir="$release_dir/bundle"
107+
msi_candidates=(
108+
"$bundle_dir"/**/*.msi
109+
)
110+
portable_candidates=(
111+
"$release_dir"/*.exe
92112
)
93-
if [ ${#installer_candidates[@]} -eq 0 ]; then
94-
echo "No Windows installer artifacts found under cross-platform/src-tauri/target/release/bundle/{nsis,msi,wix}"
95-
exit 1
96-
fi
97113
artifact_dir="PinStick-${APP_VERSION}-windows"
98114
mkdir -p "$artifact_dir"
99-
for installer_path in "${installer_candidates[@]}"; do
100-
cp "$installer_path" "$artifact_dir/"
101-
done
115+
if [ ${#msi_candidates[@]} -eq 0 ] || [ ${#portable_candidates[@]} -eq 0 ]; then
116+
echo "Expected MSI installer under $bundle_dir and portable EXE under $release_dir"
117+
if [ -d "$release_dir" ]; then
118+
find "$release_dir" -maxdepth 4 -type f | sort
119+
else
120+
echo "Release directory missing: $release_dir"
121+
fi
122+
exit 1
123+
fi
124+
cp "${msi_candidates[0]}" "$artifact_dir/PinStick-install.msi"
125+
cp "${portable_candidates[0]}" "$artifact_dir/PinStick-portable.exe"
102126
printf "WINDOWS_ARTIFACT_DIR=%s\n" "$artifact_dir" >> "$GITHUB_ENV"
103127
104128
- name: Collect Linux AppImage

cross-platform/src-tauri/tauri.conf.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"build": {
33
"beforeBuildCommand": "",
44
"beforeDevCommand": "",
5+
"withGlobalTauri": true,
56
"devPath": "../src",
67
"distDir": "../src"
78
},
@@ -14,7 +15,8 @@
1415
"active": true,
1516
"identifier": "slf.pinstick",
1617
"icon": [
17-
"icons/icon.png"
18+
"icons/icon.png",
19+
"icons/icon.ico"
1820
]
1921
},
2022
"windows": [

0 commit comments

Comments
 (0)