Skip to content

Commit b3e8d8f

Browse files
committed
Release v0.0.69
1 parent 2d5fa80 commit b3e8d8f

24 files changed

Lines changed: 2340 additions & 329 deletions

.github/workflows/release.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ jobs:
469469
TAG: ${{ github.ref_name }}
470470
run: |
471471
set -euo pipefail
472-
gh release view "${TAG}" --repo "${REPO}" --json body,publishedAt > release-meta.json
472+
gh api "/repos/${REPO}/releases/tags/${TAG}" > release-meta.json
473473
python3 - <<'PY'
474474
import json
475475
import os
@@ -480,10 +480,9 @@ jobs:
480480
with open("release-meta.json", "r", encoding="utf-8") as fh:
481481
release = json.load(fh)
482482
body = release.get("body", "") or ""
483-
pub_date = release.get("publishedAt", "") or ""
483+
pub_date = release.get("published_at", "") or release.get("publishedAt", "") or ""
484484
version = tag[1:] if tag.startswith("v") else tag
485-
486-
base = f"https://github.com/{repo}/releases/download/{tag}"
485+
assets = release.get("assets") or []
487486
488487
mac_path = pathlib.Path("updater-meta") / "updater-meta-macos" / "updater-meta-macos.json"
489488
linux_path = pathlib.Path("updater-meta") / "updater-meta-linux" / "updater-meta-linux.json"
@@ -503,11 +502,33 @@ jobs:
503502
if missing:
504503
raise SystemExit(f"Missing updater metadata: {', '.join(missing)}")
505504
505+
def pick_release_asset(suffix: str) -> dict:
506+
matches = [
507+
asset for asset in assets
508+
if isinstance(asset, dict) and (asset.get("name", "") or "").endswith(suffix)
509+
]
510+
if len(matches) != 1:
511+
names = [asset.get("name", "") for asset in assets if isinstance(asset, dict)]
512+
raise SystemExit(
513+
f"Expected exactly one release asset with suffix {suffix}, found {len(matches)}. Assets: {names}"
514+
)
515+
download_url = matches[0].get("browser_download_url", "") or ""
516+
if not download_url:
517+
raise SystemExit(f"Release asset {matches[0].get('name', '')} is missing browser_download_url")
518+
return {
519+
"asset_name": matches[0].get("name", "") or "",
520+
"url": download_url,
521+
}
522+
523+
mac_release_asset = pick_release_asset(".app.tar.gz")
524+
linux_appimage_release_asset = pick_release_asset(".AppImage")
525+
linux_deb_release_asset = pick_release_asset(".deb")
526+
506527
platforms = {
507-
"darwin-aarch64-app": {"url": f"{base}/{mac_app['asset_name']}", "signature": mac_app["signature"]},
508-
"darwin-x86_64-app": {"url": f"{base}/{mac_app['asset_name']}", "signature": mac_app["signature"]},
509-
"linux-x86_64-appimage": {"url": f"{base}/{linux_appimage['asset_name']}", "signature": linux_appimage["signature"]},
510-
"linux-x86_64-deb": {"url": f"{base}/{linux_deb['asset_name']}", "signature": linux_deb["signature"]},
528+
"darwin-aarch64-app": {"url": mac_release_asset["url"], "signature": mac_app["signature"]},
529+
"darwin-x86_64-app": {"url": mac_release_asset["url"], "signature": mac_app["signature"]},
530+
"linux-x86_64-appimage": {"url": linux_appimage_release_asset["url"], "signature": linux_appimage["signature"]},
531+
"linux-x86_64-deb": {"url": linux_deb_release_asset["url"], "signature": linux_deb["signature"]},
511532
}
512533
513534
latest = {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "lazy-blacktea",
33
"private": true,
4-
"version": "0.0.68",
4+
"version": "0.0.69",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lazy_blacktea_rust"
3-
version = "0.0.68"
3+
version = "0.0.69"
44
description = "Lazy Blacktea (Rust + Tauri)"
55
authors = ["cy76"]
66
edition = "2021"

src-tauri/src/app/adb/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ pub mod parse;
77
pub mod paths;
88
pub mod runner;
99
pub mod scrcpy;
10+
pub mod screen_record;
1011
pub mod track_devices;
1112
pub mod transfer;

src-tauri/src/app/adb/scrcpy.rs

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::path::Path;
22
use std::process::Command;
33

4-
use crate::app::config::ScrcpySettings;
4+
use crate::app::config::{ScrcpySettings, ScreenRecordSettings};
55

66
pub struct ScrcpyAvailability {
77
pub available: bool,
@@ -122,6 +122,31 @@ pub fn build_scrcpy_command(
122122
args
123123
}
124124

125+
pub fn build_scrcpy_record_command(
126+
serial: &str,
127+
settings: &ScrcpySettings,
128+
record_settings: &ScreenRecordSettings,
129+
major_version: i32,
130+
output_path: &str,
131+
time_limit_sec: i32,
132+
) -> Vec<String> {
133+
let mut record_settings_scrcpy = settings.clone();
134+
record_settings_scrcpy.enable_audio_playback = false;
135+
let mut args = build_scrcpy_command(serial, &record_settings_scrcpy, major_version);
136+
args.push("--no-window".to_string());
137+
if record_settings.display_id >= 0 {
138+
args.push("--display-id".to_string());
139+
args.push(record_settings.display_id.to_string());
140+
}
141+
args.push("--record".to_string());
142+
args.push(output_path.to_string());
143+
if time_limit_sec > 0 {
144+
args.push("--time-limit".to_string());
145+
args.push(time_limit_sec.to_string());
146+
}
147+
args
148+
}
149+
125150
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
126151
enum AudioFlagMode {
127152
AudioToggle,
@@ -242,4 +267,32 @@ mod tests {
242267
assert!(has_flag_with_value(&args, "-b", "16M"));
243268
assert!(!has_flag(&args, "--bit-rate"));
244269
}
270+
271+
#[test]
272+
fn build_scrcpy_record_command_adds_headless_recording_flags() {
273+
let settings = base_settings();
274+
let record_settings = ScreenRecordSettings {
275+
bit_rate: "4000000".to_string(),
276+
time_limit_sec: 181,
277+
size: String::new(),
278+
extra_args: String::new(),
279+
use_hevc: false,
280+
bugreport: false,
281+
verbose: false,
282+
display_id: 1,
283+
};
284+
let args = build_scrcpy_record_command(
285+
"device",
286+
&settings,
287+
&record_settings,
288+
3,
289+
"/tmp/out.mp4",
290+
181,
291+
);
292+
assert!(has_flag(&args, "--no-window"));
293+
assert!(has_flag_with_value(&args, "--record", "/tmp/out.mp4"));
294+
assert!(has_flag_with_value(&args, "--time-limit", "181"));
295+
assert!(has_flag_with_value(&args, "--display-id", "1"));
296+
assert!(has_flag(&args, "--no-audio"));
297+
}
245298
}

0 commit comments

Comments
 (0)