Skip to content

fix(docs): replace hardcoded local absolute paths with relative paths #42

fix(docs): replace hardcoded local absolute paths with relative paths

fix(docs): replace hardcoded local absolute paths with relative paths #42

Workflow file for this run

name: "Publish Release"
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
publish-tauri:
name: Build & Release (${{ matrix.platform }} - ${{ matrix.target }})
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest"
target: "aarch64-apple-darwin"
args: "--target aarch64-apple-darwin"
- platform: "windows-latest"
target: "x86_64-pc-windows-msvc"
args: ""
- platform: "ubuntu-24.04"
target: "x86_64-unknown-linux-gnu"
args: ""
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
# ── Linux ──────────────────────────────────────────────────────────────
- name: Install System Dependencies (Linux)
if: matrix.platform == 'ubuntu-24.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev \
librsvg2-dev patchelf xdg-utils \
libva-dev \
libavutil-dev libavcodec-dev libavformat-dev \
libswscale-dev libswresample-dev \
libavdevice-dev libavfilter-dev libpostproc-dev \
build-essential pkg-config libssl-dev \
libclang-dev libxdo-dev cmake \
libasound2-dev
# ── macOS ──────────────────────────────────────────────────────────────
# whisper-rs-sys builds ggml via cmake. The only reliable way to set
# the deployment target for cmake sub-builds inside cargo is via the
# SDKROOT + MACOSX_DEPLOYMENT_TARGET env pair AND setting
# CMAKE_OSX_DEPLOYMENT_TARGET through CARGO_BUILD_TARGET_DIR cmake
# passthrough. We use a .cargo/config.toml [env] block (committed) to
# guarantee cmake sees the flag, and also set it here for safety.
- name: Install FFmpeg (macOS)
if: matrix.platform == 'macos-latest'
run: |
brew install ffmpeg cmake pkg-config
BREW_PREFIX=$(brew --prefix)
FFMPEG_PREFIX=$(brew --prefix ffmpeg)
echo "FFMPEG_DIR=$FFMPEG_PREFIX" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$FFMPEG_PREFIX/lib/pkgconfig:$BREW_PREFIX/lib/pkgconfig" >> $GITHUB_ENV
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV
echo "CMAKE_OSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV
# ── Windows ────────────────────────────────────────────────────────────
# LLVM is already available on windows-latest at C:\Program Files\LLVM
# (installed by the runner image). Just set LIBCLANG_PATH.
- name: Set LIBCLANG_PATH (Windows)
if: matrix.platform == 'windows-latest'
shell: powershell
run: |
$llvm = "C:\Program Files\LLVM\bin"
if (Test-Path $llvm) {
echo "LIBCLANG_PATH=$llvm" >> $env:GITHUB_ENV
Write-Host "Using runner LLVM at $llvm"
} else {
choco install llvm -y --no-progress
echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" >> $env:GITHUB_ENV
}
- name: Install FFmpeg (Windows)
if: matrix.platform == 'windows-latest'
shell: powershell
run: |
cd C:\vcpkg
git pull --quiet
vcpkg install ffmpeg[core,avcodec,avdevice,avfilter,avformat,swresample,swscale]:x64-windows-static-md
echo "FFMPEG_DIR=C:/vcpkg/installed/x64-windows-static-md" >> $env:GITHUB_ENV
echo "PKG_CONFIG_PATH=C:/vcpkg/installed/x64-windows-static-md/lib/pkgconfig" >> $env:GITHUB_ENV
echo "VCPKG_ROOT=C:\vcpkg" >> $env:GITHUB_ENV
echo "VCPKGRS_TRIPLET=x64-windows-static-md" >> $env:GITHUB_ENV
# ── Toolchain ──────────────────────────────────────────────────────────
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
workspaces: src-tauri
# ── Frontend ───────────────────────────────────────────────────────────
- name: Install Frontend Dependencies
run: npm ci
- name: Run Vitest Suite
run: npx vitest run
- name: Run Cargo Test Suite
if: matrix.platform == 'ubuntu-24.04'
run: cargo test --manifest-path src-tauri/Cargo.toml
# ── Release ────────────────────────────────────────────────────────────
- name: Build & Publish Release
uses: tauri-apps/tauri-action@action-v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tagName: v__VERSION__
releaseName: "Clypra v__VERSION__"
releaseBody: "Automated multi-platform release bundle — macOS (arm64), Windows (x64), Linux (x64)."
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}
sync-updater-manifests:
name: Sync latest.json and updater.json
needs: publish-tauri
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Duplicate latest.json as updater.json and convert to Direct Public URLs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME="${{ github.ref_name }}"
if [ -z "$TAG_NAME" ] || [ "$TAG_NAME" = "main" ]; then
TAG_NAME=$(gh release view --json tagName -q .tagName --repo ${{ github.repository }})
fi
echo "Syncing manifests for release: $TAG_NAME"
gh release download "$TAG_NAME" -p "latest.json" --repo ${{ github.repository }} --dir /tmp
# Map GitHub API asset URLs to public direct download URLs
node -e '
const fs = require("fs");
const { execSync } = require("child_process");
const repo = process.env.GITHUB_REPOSITORY || "${{ github.repository }}";
const tag = "'"$TAG_NAME"'";
const releaseInfo = JSON.parse(execSync(`gh release view "${tag}" --json assets --repo "${repo}"`).toString());
const assetMap = new Map();
for (const asset of releaseInfo.assets) {
if (asset.apiUrl) {
assetMap.set(asset.apiUrl, asset.url);
}
if (asset.id) {
assetMap.set(`https://api.github.com/repos/${repo}/releases/assets/${asset.id}`, asset.url);
assetMap.set(`https://api.github.com/repos/AIEraDev/Clypra/releases/assets/${asset.id}`, asset.url);
assetMap.set(`https://api.github.com/repos/AIEraDev/clypra/releases/assets/${asset.id}`, asset.url);
}
}
const manifest = JSON.parse(fs.readFileSync("/tmp/latest.json", "utf8"));
if (manifest.platforms) {
for (const [platform, data] of Object.entries(manifest.platforms)) {
if (data.url && data.url.includes("api.github.com")) {
const directUrl = assetMap.get(data.url);
if (directUrl) {
console.log(`Rewriting ${platform} URL from ${data.url} to ${directUrl}`);
data.url = directUrl;
}
}
}
}
const updatedJson = JSON.stringify(manifest, null, 2);
fs.writeFileSync("/tmp/latest.json", updatedJson);
fs.writeFileSync("/tmp/updater.json", updatedJson);
'
gh release upload "$TAG_NAME" /tmp/latest.json /tmp/updater.json --clobber --repo ${{ github.repository }}
echo "Successfully converted and published both latest.json and updater.json with direct public download URLs!"