Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,35 @@ jobs:
libasound2-dev libpulse-dev libssl-dev \
libx11-dev libxtst-dev libxrandr-dev libxkbcommon-dev pkg-config

# The speech engine's Vulkan backend (see src-tauri/Cargo.toml) is
# compiled with the Vulkan headers and shader compiler; Parler itself
# never needs Vulkan to start.
- name: Install the Vulkan SDK (Linux)
if: runner.os == 'Linux'
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.290-jammy.list https://packages.lunarg.com/vulkan/1.3.290/lunarg-vulkan-1.3.290-jammy.list
sudo apt-get update
sudo apt-get install -y vulkan-sdk

- name: Install the Vulkan SDK (Windows)
if: runner.os == 'Windows'
uses: humbletim/install-vulkan-sdk@v1.2
with:
version: 1.4.309.0
cache: true

# ggml-vulkan looks for SPIRV-Headers as a CMake package, which the SDK
# above doesn't expose on Windows.
- name: Install SPIRV-Headers (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
vcpkg install spirv-headers:x64-windows
if ($LASTEXITCODE -ne 0) { throw "vcpkg install spirv-headers failed" }
$prefix = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows" -replace '\\','/'
Add-Content $env:GITHUB_ENV "CMAKE_PREFIX_PATH=$prefix"

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
Expand Down
126 changes: 126 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,36 @@ jobs:
libasound2-dev libpulse-dev libssl-dev \
libx11-dev libxtst-dev libxrandr-dev libxkbcommon-dev pkg-config

# The speech engine's Vulkan backend (see src-tauri/Cargo.toml) is
# compiled with the Vulkan headers and shader compiler. The bundles
# don't ship Vulkan: Parler uses the system's driver when there is one
# and the CPU otherwise.
- name: Install the Vulkan SDK (Linux)
if: runner.os == 'Linux'
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.290-jammy.list https://packages.lunarg.com/vulkan/1.3.290/lunarg-vulkan-1.3.290-jammy.list
sudo apt-get update
sudo apt-get install -y vulkan-sdk

- name: Install the Vulkan SDK (Windows)
if: runner.os == 'Windows'
uses: humbletim/install-vulkan-sdk@v1.2
with:
version: 1.4.309.0
cache: true

# ggml-vulkan looks for SPIRV-Headers as a CMake package, which the SDK
# above doesn't expose on Windows.
- name: Install SPIRV-Headers (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
vcpkg install spirv-headers:x64-windows
if ($LASTEXITCODE -ne 0) { throw "vcpkg install spirv-headers failed" }
$prefix = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows" -replace '\\','/'
Add-Content $env:GITHUB_ENV "CMAKE_PREFIX_PATH=$prefix"

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust_targets }}
Expand Down Expand Up @@ -156,8 +186,44 @@ jobs:
} >> "$GITHUB_ENV"
echo "::notice::Update bundles will be signed."

# Parler links libtranscribe, which lives in the cargo build tree until
# the bundles copy it (build.rs stages it with the ggml modules). The
# AppImage's linuxdeploy resolves every library the binary needs and
# fails on one it can't find, so build first and show it where.
- name: Build the speech engine first (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
set -euo pipefail
pnpm build
(cd src-tauri && cargo build --release --target "${{ matrix.target }}")
lib_dir=$(find "src-tauri/target/${{ matrix.target }}/release/build" -type f -name transcribe-link.json \
-path '*transcribe-cpp-sys*/out/lib/*' -printf '%T@ %h\n' | sort -rn | head -1 | cut -d' ' -f2-)
if [ -z "$lib_dir" ]; then echo "::error::No transcribe-cpp libraries built."; exit 1; fi
ls -la "$lib_dir"
echo "LD_LIBRARY_PATH=$lib_dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
sudo cp -vL "$lib_dir"/libtranscribe.so* "$lib_dir"/libggml*.so* /usr/local/lib/
sudo ldconfig

# Tauri's own linuxdeploy predates LINUXDEPLOY_EXCLUDED_LIBRARIES (used
# below): a current one goes where Tauri looks for it.
- name: Install a current linuxdeploy (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
set -euo pipefail
tools="${XDG_CACHE_HOME:-$HOME/.cache}/tauri"
mkdir -p "$tools"
curl -L --fail --show-error --retry 3 -o "$tools/linuxdeploy-x86_64.AppImage" \
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x "$tools/linuxdeploy-x86_64.AppImage"

- name: Build Tauri bundle
shell: bash
env:
# The Vulkan loader must come from the system, matching its driver:
# never bundled into the AppImage.
LINUXDEPLOY_EXCLUDED_LIBRARIES: ${{ runner.os == 'Linux' && 'libvulkan.so*' || '' }}
run: |
set -euo pipefail
args=(--target "${{ matrix.target }}")
Expand All @@ -166,6 +232,66 @@ jobs:
fi
pnpm tauri build "${args[@]}"

# Without the engine's libraries next to it, Parler wouldn't even start
# (Linux, Windows): never publish a bundle that lacks them.
- name: Check the bundles carry the speech engine
if: runner.os != 'macOS'
shell: bash
run: |
set -euo pipefail
out="src-tauri/target/${{ matrix.target }}/release/bundle"
if [ "$RUNNER_OS" = "Linux" ]; then
# Each package must carry the engine; on a miss, say which file
# and show what the package holds instead.
need() { # listing, pattern, what
echo "$1" | grep -Eq "$2" || {
echo "::error::$3 lacks $2"
echo "$1" | grep -Ei 'transcribe|ggml|vulkan' || echo "(no engine library at all)"
exit 1
}
}
# The app must find every library it links where the package
# puts it: no "not found" from ldd once unpacked.
loads() { # unpacked root, what
bin=$(find "$1/usr/bin" -type f | head -1)
missing=$(ldd "$bin" | grep 'not found' || true)
if [ -n "$missing" ]; then
echo "::error::$2: $bin can't find $missing"; exit 1
fi
}
for pkg in "$out"/deb/*.deb; do
listing=$(dpkg-deb -c "$pkg")
need "$listing" 'usr/lib/Parler/libtranscribe\.so' "$pkg"
need "$listing" 'usr/lib/Parler/libggml-cpu' "$pkg"
need "$listing" 'usr/lib/Parler/libggml-vulkan\.so' "$pkg"
root="$RUNNER_TEMP/deb-root"
rm -rf "$root" && dpkg-deb -x "$pkg" "$root"
loads "$root" "$pkg"
done
for pkg in "$out"/rpm/*.rpm; do
need "$(rpm -qlp "$pkg")" 'usr/lib/Parler/libtranscribe\.so' "$pkg"
done
image=$(find "$out/appimage" -name '*.AppImage' | head -1)
chmod +x "$image"
(cd "$RUNNER_TEMP" && "$OLDPWD/$image" --appimage-extract >/dev/null)
listing=$(cd "$RUNNER_TEMP/squashfs-root" && find . -name '*.so*')
need "$listing" 'libtranscribe\.so' "$image"
need "$listing" 'libggml-vulkan\.so' "$image"
if echo "$listing" | grep -q 'libvulkan\.so'; then
echo "::error::The AppImage bundles the Vulkan loader."; exit 1
fi
loads "$RUNNER_TEMP/squashfs-root" "$image"
else
# 7-Zip lists what the NSIS installer unpacks (the MSI keeps its
# files in a cabinet it doesn't name); both bundle the same list.
for installer in "$out"/nsis/*.exe; do
listing=$(7z l "$installer")
for dll in transcribe.dll ggml-vulkan.dll msvcp140.dll; do
echo "$listing" | grep -qi "$dll" || { echo "::error::$installer lacks $dll"; exit 1; }
done
done
fi

# Nothing is published unless Apple accepted the build and the ticket is
# stapled into the .dmg users download. A congested notary service
# delays the release rather than shipping an unverifiable one.
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ src-tauri/gen

# Local agent scratch
.claude/

# The speech engine's libraries, gathered by src-tauri/build.rs for the bundles
src-tauri/transcribe-libs
Loading
Loading