@@ -61,15 +61,64 @@ jobs:
6161 - name : Normalize updater assets
6262 shell : bash
6363 run : |
64+ set -euo pipefail
65+
6466 mkdir -p normalized
6567 if [[ "${RUNNER_OS}" == "macOS" ]]; then
66- archive="$(find "src-tauri/target/${{ matrix.target }}/release/bundle/macos" -name '*.app.tar.gz' -type f | head -1)"
68+ search_dirs=()
69+ for dir in \
70+ "src-tauri/target/${{ matrix.target }}/release/bundle/macos" \
71+ "src-tauri/target/release/bundle/macos"
72+ do
73+ if [[ -d "${dir}" ]]; then
74+ search_dirs+=("${dir}")
75+ fi
76+ done
77+
78+ if [[ "${#search_dirs[@]}" -eq 0 ]]; then
79+ echo "No Tauri macOS bundle directories were found."
80+ exit 1
81+ fi
82+
83+ archive="$(find "${search_dirs[@]}" -maxdepth 1 -type f -name '*.app.tar.gz' | head -n 1)"
84+ signature="$(find "${search_dirs[@]}" -maxdepth 1 -type f -name '*.app.tar.gz.sig' | head -n 1)"
85+ if [[ -z "${archive}" || -z "${signature}" ]]; then
86+ echo "The macOS updater archive or signature is missing."
87+ exit 1
88+ fi
89+
6790 cp "${archive}" "normalized/taskmate-${{ matrix.suffix }}.app.tar.gz"
68- cp "${archive}.sig " "normalized/taskmate-${{ matrix.suffix }}.app.tar.gz.sig"
91+ cp "${signature} " "normalized/taskmate-${{ matrix.suffix }}.app.tar.gz.sig"
6992 else
70- setup="$(find "src-tauri/target/${{ matrix.target }}/release/bundle/nsis" -name '*-setup.exe' -type f | head -1)"
93+ search_dirs=()
94+ for dir in \
95+ "src-tauri/target/${{ matrix.target }}/release/bundle/nsis" \
96+ "src-tauri/target/release/bundle/nsis"
97+ do
98+ if [[ -d "${dir}" ]]; then
99+ search_dirs+=("${dir}")
100+ fi
101+ done
102+
103+ if [[ "${#search_dirs[@]}" -eq 0 ]]; then
104+ echo "No Tauri NSIS bundle directories were found."
105+ exit 1
106+ fi
107+
108+ setup="$(find "${search_dirs[@]}" -maxdepth 1 -type f -name '*-setup.exe' | head -n 1)"
109+ if [[ -z "${setup}" ]]; then
110+ echo "The Windows setup executable is missing."
111+ exit 1
112+ fi
113+
114+ signature="${setup}.sig"
115+ if [[ ! -f "${signature}" ]]; then
116+ echo "The Windows setup executable signature is missing: ${signature}"
117+ exit 1
118+ fi
119+
71120 cp "${setup}" "normalized/taskmate-${{ matrix.suffix }}-setup.exe"
72- cp "${setup}.sig " "normalized/taskmate-${{ matrix.suffix }}-setup.exe.sig"
121+ cp "${signature} " "normalized/taskmate-${{ matrix.suffix }}-setup.exe.sig"
73122 fi
74123 - uses : softprops/action-gh-release@v2
75124 with :
0 commit comments