Compare commits

...
6 changed files with 64 additions and 9 deletions

No files matched your search

Generated
+1 -1
View File
@@ -425,7 +425,7 @@ dependencies = [
[[package]]
name = "framely"
version = "0.7.0-preview.1"
version = "0.7.0-preview.2"
dependencies = [
"anyhow",
"base64",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "framely"
version = "0.7.0-preview.1"
version = "0.7.0-preview.2"
edition = "2021"
license = "AGPL-3.0-only"
+3 -3
View File
@@ -38,7 +38,7 @@ Deleted `/home` data cannot be recovered. OS updates may require manual interven
Device and installer share the repository with independent versions/tags/workflows:
- Device: root Cargo version, `v<version>` (currently `v0.7.0-preview.1`), `.github/workflows/release.yml`, Linux ARM64 and pinned CEF.
- Device: root Cargo version, `v<version>` (currently `v0.7.0-preview.2`), `.github/workflows/release.yml`, Linux ARM64 and pinned CEF.
- Installer: `installer/Cargo.toml`, `installer-v<version>` (currently `installer-v0.4.1-preview.10`), `.github/workflows/installer-release.yml`, Linux x64/ARM64, Windows x64, macOS Intel/Apple Silicon, pinned GPUI Kit.
Versions need not match or ship together. Update the relevant Cargo.lock with version changes. Installer package/macOS versions use the installer version.
@@ -47,8 +47,8 @@ Both workflows cache dependencies/builds by product/platform/toolchain/configura
```bash
# After committing and pushing the intended source:
git tag v0.7.0-preview.1
git push origin v0.7.0-preview.1
git tag v0.7.0-preview.2
git push origin v0.7.0-preview.2
# Independent installer release:
git tag installer-v0.4.1-preview.10
git push origin installer-v0.4.1-preview.10
+3 -3
View File
@@ -48,7 +48,7 @@ CEF 按内容哈希保存在 `/home/.framely/cef/<运行库标识>`,更新时
Framely 和桌面安装器保留在同一仓库,使用独立的版本号、标签和发布工作流:
- Framely:版本由根 `Cargo.toml` 定义,标签为 `v<版本>`(当前 `v0.7.0-preview.1`);`.github/workflows/release.yml` 只构建 Frame Linux ARM64 发行,使用锁定的 CEF 并执行自动检查。
- Framely:版本由根 `Cargo.toml` 定义,标签为 `v<版本>`(当前 `v0.7.0-preview.2`);`.github/workflows/release.yml` 只构建 Frame Linux ARM64 发行,使用锁定的 CEF 并执行自动检查。
- 安装器:版本由 `installer/Cargo.toml` 定义,标签为 `installer-v<版本>`(当前 `installer-v0.4.1-preview.10`);`.github/workflows/installer-release.yml` 只构建 Linux x64/ARM64、Windows x64、macOS x64/ARM64 的原生安装器,使用锁定的 GPUI Kit。
两个版本不需要相同,也不需要同时发布。修改各自版本时同步对应的 `Cargo.lock`;安装器包名及 macOS 应用版本使用安装器版本。
@@ -59,8 +59,8 @@ Framely 和桌面安装器保留在同一仓库,使用独立的版本号、标
```bash
# 提交并推送代码后,选择需要发布的产品
git tag v0.7.0-preview.1
git push origin v0.7.0-preview.1
git tag v0.7.0-preview.2
git push origin v0.7.0-preview.2
# 独立发布安装器,不触发 Framely 构建
git tag installer-v0.4.1-preview.10
+54
View File
@@ -0,0 +1,54 @@
"""Keep media packaging aligned with Cargo's default and overridden output paths."""
import os
from pathlib import Path
import shutil
import subprocess
import tempfile
import unittest
ROOT = Path(__file__).resolve().parents[1]
class MediaBuildOutput(unittest.TestCase):
def test_copies_compiled_binaries_from_cargo_target_directory(self):
cargo = shutil.which('cargo')
self.assertIsNotNone(cargo)
for setting in (None, 'target/cargo', 'absolute'):
with self.subTest(target=setting), tempfile.TemporaryDirectory() as directory:
root = Path(directory)
(root / 'tools').mkdir()
source = (ROOT / 'tools/build-media.sh').read_text()
# Native dependencies are separate from the Cargo output-copy boundary.
(root / 'tools/build-media.sh').write_text(source.split('# Native dependencies')[0])
crate = root / 'media/capture'
(crate / 'src').mkdir(parents=True)
(crate / 'Cargo.toml').write_text('[package]\nname="capture-fixture"\nversion="0.1.0"\nedition="2021"\n')
(crate / 'src/main.rs').write_text('fn main() {}\n')
env = dict(os.environ)
env.pop('CARGO_TARGET_DIR', None)
env.pop('FRAMELY_SYSROOT', None)
if setting:
env['CARGO_TARGET_DIR'] = str(root / 'absolute-output') if setting == 'absolute' else setting
subprocess.run([cargo, 'generate-lockfile', '--manifest-path', str(crate / 'Cargo.toml')], env=env, check=True)
mock_bin = root / 'mock-bin'
mock_bin.mkdir()
wrapper = mock_bin / 'cargo'
wrapper.write_text('''#!/usr/bin/env python3
import json,os,pathlib,subprocess,sys
real=os.environ['TEST_REAL_CARGO']
if sys.argv[1]=='build':
result=subprocess.check_output([real,'metadata','--locked','--no-deps','--format-version','1','--manifest-path','media/capture/Cargo.toml'])
output=pathlib.Path(json.loads(result)['target_directory'])/'release'
output.mkdir(parents=True,exist_ok=True)
for name in ['framely-capture','framely-panel-grab']:(output/name).write_text('compiled '+name)
else:os.execv(real,[real,*sys.argv[1:]])
''')
wrapper.chmod(0o755)
env.update(TEST_REAL_CARGO=cargo, PATH=str(mock_bin) + os.pathsep + env['PATH'])
subprocess.run(['bash', str(root / 'tools/build-media.sh')], cwd=root, env=env, check=True)
for name in ('framely-capture', 'framely-panel-grab'):
self.assertEqual((root / 'media/bin' / name).read_text(), 'compiled ' + name)
if __name__ == '__main__':
unittest.main()
+2 -1
View File
@@ -16,7 +16,8 @@ fi
cargo build --release --locked --manifest-path media/capture/Cargo.toml
)
mkdir -p media/bin
cp media/capture/target/release/framely-capture media/capture/target/release/framely-panel-grab media/bin/
capture_target=$(cargo metadata --locked --no-deps --format-version 1 --manifest-path media/capture/Cargo.toml | python3 -c 'import json,sys; print(json.load(sys.stdin)["target_directory"])')
cp "$capture_target/release/framely-capture" "$capture_target/release/framely-panel-grab" media/bin/
# Native dependencies use the target system's GStreamer and GUPnP libraries.
python3 tools/fetch-media.py
bash tools/build-gst-libav.sh