@@ -175,21 +175,14 @@ jobs:
175175 mkdir -p dist
176176 msi_path="$(find target crates/agent-gui/src-tauri/target -type f -name '*.msi' -path '*bundle*' -print -quit 2>/dev/null || true)"
177177 exe_path="$(find target crates/agent-gui/src-tauri/target -type f -name '*.exe' -path '*bundle*' -print -quit 2>/dev/null || true)"
178- nsis_zip_path="$(find target crates/agent-gui/src-tauri/target -type f -name '*.exe.zip' -path '*bundle*' -print -quit 2>/dev/null || true)"
179- msi_zip_path="$(find target crates/agent-gui/src-tauri/target -type f -name '*.msi.zip' -path '*bundle*' -print -quit 2>/dev/null || true)"
180178 test -n "$msi_path"
181179 test -n "$exe_path"
182- test -n "$nsis_zip_path "
183- test -f "$nsis_zip_path .sig"
180+ test -f "$msi_path.sig "
181+ test -f "$exe_path .sig"
184182 cp "$msi_path" "dist/LiveAgent-${RELEASE_TAG}-Windows-x64.msi"
183+ cp "$msi_path.sig" "dist/LiveAgent-${RELEASE_TAG}-Windows-x64.msi.sig"
185184 cp "$exe_path" "dist/LiveAgent-${RELEASE_TAG}-Windows-x64-Setup.exe"
186- cp "$nsis_zip_path" "dist/LiveAgent-${RELEASE_TAG}-Windows-x64-nsis.zip"
187- cp "$nsis_zip_path.sig" "dist/LiveAgent-${RELEASE_TAG}-Windows-x64-nsis.zip.sig"
188- if [ -n "$msi_zip_path" ]; then
189- test -f "$msi_zip_path.sig"
190- cp "$msi_zip_path" "dist/LiveAgent-${RELEASE_TAG}-Windows-x64-msi.zip"
191- cp "$msi_zip_path.sig" "dist/LiveAgent-${RELEASE_TAG}-Windows-x64-msi.zip.sig"
192- fi
185+ cp "$exe_path.sig" "dist/LiveAgent-${RELEASE_TAG}-Windows-x64-Setup.exe.sig"
193186 test "$(find dist -type f | wc -l)" -gt 0
194187
195188 - uses : actions/upload-artifact@v7
@@ -257,27 +250,18 @@ jobs:
257250 appimage_path="$(find crates/agent-gui/src-tauri/target target -type f -name '*.AppImage' -path '*bundle*' -print -quit 2>/dev/null || true)"
258251 deb_path="$(find crates/agent-gui/src-tauri/target target -type f -name '*.deb' -path '*bundle*' -print -quit 2>/dev/null || true)"
259252 rpm_path="$(find crates/agent-gui/src-tauri/target target -type f -name '*.rpm' -path '*bundle*' -print -quit 2>/dev/null || true)"
260- appimage_updater_path="$(find crates/agent-gui/src-tauri/target target -type f -name '*.AppImage.tar.gz' -path '*bundle*' -print -quit 2>/dev/null || true)"
261- deb_updater_path="$(find crates/agent-gui/src-tauri/target target -type f -name '*.deb.tar.gz' -path '*bundle*' -print -quit 2>/dev/null || true)"
262- rpm_updater_path="$(find crates/agent-gui/src-tauri/target target -type f -name '*.rpm.tar.gz' -path '*bundle*' -print -quit 2>/dev/null || true)"
263253 test -n "$appimage_path"
264254 test -n "$deb_path"
265255 test -n "$rpm_path"
266- test -n "$appimage_updater_path"
267- test -n "$deb_updater_path"
268- test -n "$rpm_updater_path"
269- test -f "$appimage_updater_path.sig"
270- test -f "$deb_updater_path.sig"
271- test -f "$rpm_updater_path.sig"
256+ test -f "$appimage_path.sig"
257+ test -f "$deb_path.sig"
258+ test -f "$rpm_path.sig"
272259 cp "$appimage_path" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.AppImage"
260+ cp "$appimage_path.sig" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.AppImage.sig"
273261 cp "$deb_path" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.deb"
262+ cp "$deb_path.sig" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.deb.sig"
274263 cp "$rpm_path" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.rpm"
275- cp "$appimage_updater_path" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.AppImage.tar.gz"
276- cp "$appimage_updater_path.sig" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.AppImage.tar.gz.sig"
277- cp "$deb_updater_path" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.deb.tar.gz"
278- cp "$deb_updater_path.sig" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.deb.tar.gz.sig"
279- cp "$rpm_updater_path" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.rpm.tar.gz"
280- cp "$rpm_updater_path.sig" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.rpm.tar.gz.sig"
264+ cp "$rpm_path.sig" "dist/LiveAgent-${RELEASE_TAG}-Linux-x86_64.rpm.sig"
281265
282266 - uses : actions/upload-artifact@v7
283267 with :
@@ -307,12 +291,53 @@ jobs:
307291 RELEASE_TAG : ${{ github.event.inputs.tag || github.ref_name }}
308292 run : |
309293 set -euo pipefail
310- prerelease_args=()
294+ is_prerelease=false
311295 if [[ "$RELEASE_TAG" =~ -(alpha|beta|rc|pre|preview|next) ]]; then
312- prerelease_args+=(--prerelease)
296+ is_prerelease=true
297+ fi
298+
299+ notes_path="$RUNNER_TEMP/liveagent-release-notes.md"
300+ if ! gh api "repos/$GH_REPO/releases/generate-notes" \
301+ -f tag_name="$RELEASE_TAG" \
302+ --jq ".body" > "$notes_path"; then
303+ printf 'LiveAgent %s\n' "$RELEASE_TAG" > "$notes_path"
304+ fi
305+ if [ ! -s "$notes_path" ]; then
306+ printf 'LiveAgent %s\n' "$RELEASE_TAG" > "$notes_path"
307+ fi
308+
309+ if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
310+ edit_args=(--title "LiveAgent $RELEASE_TAG" --notes-file "$notes_path")
311+ if [ "$is_prerelease" = true ]; then
312+ edit_args+=(--prerelease)
313+ else
314+ edit_args+=(--prerelease=false --latest)
315+ fi
316+ gh release edit "$RELEASE_TAG" "${edit_args[@]}"
317+ else
318+ create_args=(--verify-tag --title "LiveAgent $RELEASE_TAG" --notes-file "$notes_path")
319+ if [ "$is_prerelease" = true ]; then
320+ create_args+=(--prerelease)
321+ fi
322+ gh release create "$RELEASE_TAG" "${create_args[@]}"
313323 fi
314- gh release view "$RELEASE_TAG" >/dev/null 2>&1 || \
315- gh release create "$RELEASE_TAG" "${prerelease_args[@]}" --title "LiveAgent $RELEASE_TAG" --notes "Automated LiveAgent release."
316- gh release upload "$RELEASE_TAG" release-artifacts/* --clobber
317- node scripts/release/create-tauri-updater-manifest.mjs release-artifacts release-artifacts/latest.json
324+
325+ mapfile -t signature_assets < <(gh release view "$RELEASE_TAG" --json assets --jq '.assets[].name | select(endswith(".sig"))')
326+ for asset in "${signature_assets[@]}"; do
327+ gh release delete-asset "$RELEASE_TAG" "$asset" --yes
328+ done
329+
330+ rm -rf public-release-assets
331+ mkdir -p public-release-assets
332+ find release-artifacts -maxdepth 1 -type f ! -name '*.sig' ! -name latest.json -exec cp {} public-release-assets/ \;
333+
334+ shopt -s nullglob
335+ public_assets=(public-release-assets/*)
336+ if [ "${#public_assets[@]}" -eq 0 ]; then
337+ echo "No public release assets were found."
338+ exit 1
339+ fi
340+ gh release upload "$RELEASE_TAG" "${public_assets[@]}" --clobber
341+
342+ node scripts/release/create-tauri-updater-manifest.mjs release-artifacts release-artifacts/latest.json "$notes_path"
318343 gh release upload "$RELEASE_TAG" release-artifacts/latest.json --clobber
0 commit comments