From 6afa51b993362a52c983703f0aaff70c651f8ab5 Mon Sep 17 00:00:00 2001 From: Mitchell Date: Thu, 18 Jun 2026 00:15:14 -0500 Subject: [PATCH] chore: build, UI updates - UI - Disable capture source button if video capture is not supported. - Update message when video capture is not supported. - CI - Update install script to output installed, or updated version. - Add action to verify install script. --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++---- install.sh | 11 ++++++++- src/ui/draw_bottom_panel.zig | 2 ++ src/ui/draw_video_preview.zig | 2 +- 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85074f8..afb0267 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,20 +88,16 @@ jobs: - name: Package Linux Binary run: mv zig-out/linux/spacecap zig-out/linux/spacecap-linux-x86_64 - # - name: Package Windows - # run: zip -r spacecap-windows-x86_64.zip zig-out/windows - name: Generate Checksums run: | sha256sum zig-out/linux/spacecap-linux-x86_64 > SHA256SUMS.txt - # sha256sum spacecap-windows-x86_64.zip >> SHA256SUMS.txt sha256sum zig-out/linux/spacecap-linux-x86_64.AppImage >> SHA256SUMS.txt - name: Upload Workflow Artifacts uses: actions/upload-artifact@v4 with: name: spacecap-release-assets - # spacecap-windows-x86_64.zip is currently disabled. path: | zig-out/linux/spacecap-linux-x86_64 zig-out/linux/spacecap-linux-x86_64.AppImage @@ -139,8 +135,45 @@ jobs: prerelease: ${{ steps.version.outputs.prerelease }} generate_release_notes: ${{ github.ref_type != 'tag' || steps.existing_release.outputs.exists != 'true' }} append_body: false - # spacecap-windows-x86_64.zip is currently disabled. files: | zig-out/linux/spacecap-linux-x86_64 zig-out/linux/spacecap-linux-x86_64.AppImage SHA256SUMS.txt + + - name: Test Install Script + env: + EXPECTED_VERSION: ${{ steps.built_version.outputs.release_version }} + run: | + set -euo pipefail + + install_home="$(mktemp -d)" + trap 'rm -rf "$install_home"' EXIT + + install_args="" + if [ "${GITHUB_REF_TYPE}" != "tag" ]; then + install_args="--nightly" + fi + + for attempt in 1 2 3 4 5; do + rm -rf "$install_home" + mkdir -p "$install_home" + install_path="$install_home/.local/bin/spacecap" + + if install_output="$(HOME="$install_home" APPIMAGE_EXTRACT_AND_RUN=1 sh ./install.sh $install_args)"; then + echo "$install_output" + expected_install_output="Installed spacecap version $EXPECTED_VERSION to $install_path." + if ! printf '%s\n' "$install_output" | grep -Fqx "$expected_install_output"; then + echo "Install output mismatch on attempt $attempt. Expected line: $expected_install_output" >&2 + continue + fi + + exit 0 + fi + + if [ "$attempt" -eq 5 ]; then + echo "install.sh did not install the expected version after $attempt attempts" >&2 + exit 1 + fi + + sleep 10 + done diff --git a/install.sh b/install.sh index c724ab0..40cf09f 100755 --- a/install.sh +++ b/install.sh @@ -72,6 +72,10 @@ DESKTOP_DIR="$DATA_DIR/applications" DESKTOP_PATH="$DESKTOP_DIR/$APP_NAME.desktop" ICON_DIR="$DATA_DIR/icons/hicolor/scalable/apps" ICON_PATH="$ICON_DIR/$APP_NAME.svg" +WAS_INSTALLED=0 +if [ -e "$INSTALL_PATH" ] || [ -L "$INSTALL_PATH" ]; then + WAS_INSTALLED=1 +fi if [ "$MODE" = "uninstall" ]; then REMOVED=0 @@ -137,7 +141,12 @@ mv "$APPIMAGE_TMP" "$INSTALL_PATH" mv "$DESKTOP_TMP" "$DESKTOP_PATH" mv "$ICON_TMP" "$ICON_PATH" -echo "Installed $APP_NAME to $INSTALL_PATH." +VERSION="$("$INSTALL_PATH" --version)" +if [ "$WAS_INSTALLED" -eq 1 ]; then + echo "Updated $APP_NAME to version $VERSION at $INSTALL_PATH." +else + echo "Installed $APP_NAME version $VERSION to $INSTALL_PATH." +fi echo "Installed the desktop entry to $DESKTOP_PATH." echo "Installed the app icon to $ICON_PATH." diff --git a/src/ui/draw_bottom_panel.zig b/src/ui/draw_bottom_panel.zig index 567e5f8..593e9fd 100644 --- a/src/ui/draw_bottom_panel.zig +++ b/src/ui/draw_bottom_panel.zig @@ -68,9 +68,11 @@ pub fn draw_bottom_panel(allocator: Allocator, store: *Store, state: *Store.Stat c.ImGui_TableNextRow(); _ = c.ImGui_TableNextColumn(); const video_source_button_label = if (state.capture.video_capture_active) "󰦳 New Source" else "󰦳 Select Source"; + c.ImGui_BeginDisabled(!state.capture.is_video_capture_supprted); if (c.ImGui_ButtonEx(video_source_button_label, .{ .x = c.ImGui_GetContentRegionAvail().x, .y = 0 })) { store.dispatch(.{ .capture = .{ .select_video_source = .{ .source_type = .all } } }); } + c.ImGui_EndDisabled(); const video_capture_ready = state.capture.is_video_capture_supprted and state.capture.video_capture_active; diff --git a/src/ui/draw_video_preview.zig b/src/ui/draw_video_preview.zig index e72fe79..f7d04ca 100644 --- a/src/ui/draw_video_preview.zig +++ b/src/ui/draw_video_preview.zig @@ -67,7 +67,7 @@ pub fn draw_video_preview( c.ImGui_Image(capture_preview.capture_preview_buffer.im_texture_ref, .{ .x = render_width, .y = render_height }); }, .vulkan_video_not_supported => { - const message = "Vulkan video is not supported on your current hardware. Video recording will be disabled."; + const message = "Video capture is disabled. Vulkan video is not supported on your current hardware, or your video drivers may be out of date."; const wrap_width = container_width * 0.8; const text_size = c.ImGui_CalcTextSizeEx(message, null, false, wrap_width); const cursor_x = (container_width - text_size.x) / 2;