Update versioning across multiple packages and enhance GitHub Actions workflow

- Changed versioning from "2.0.0-pre.1" to "2.0.0-alpha.1" in various Cargo.toml files and package.json to reflect a new alpha release.
- Added support for ARM64 builds in the GitHub Actions workflow, including a new host configuration and installation of VA-API libraries for the ARM target.
- Introduced a new `bump` command in the xtask to facilitate version updates across all relevant files, improving version management.
This commit is contained in:
Jamie Pine
2026-02-05 22:58:11 -08:00
parent 92020cdc9e
commit 9de7ee88ed
12 changed files with 234 additions and 8 deletions

View File

@@ -104,6 +104,11 @@ jobs:
bundles: deb
os: linux
arch: x86_64
- host: blacksmith-8vcpu-ubuntu-2204-arm
target: aarch64-unknown-linux-gnu
bundles: deb
os: linux
arch: aarch64
name: Desktop - Main ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
@@ -128,6 +133,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install VA-API libraries
if: matrix.settings.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get update && sudo apt-get install -y libva-dev libva-drm2
- name: Install Apple API key
if: ${{ runner.os == 'macOS' }}
run: |

BIN
Cargo.lock generated
View File

Binary file not shown.

View File

@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "sd-cli"
version = "2.0.0-pre.1"
version = "2.0.0-alpha.1"
[features]
default = []

View File

@@ -1,6 +1,6 @@
[package]
name = "sd-server"
version = "2.0.0-pre.1"
version = "2.0.0-alpha.1"
edition = "2021"
[features]

View File

@@ -1,7 +1,7 @@
{
"name": "@sd/tauri",
"private": true,
"version": "2.0.0",
"version": "2.0.0-alpha.1",
"type": "module",
"engines": {
"bun": ">=1.3.0"

View File

@@ -1,6 +1,6 @@
[package]
name = "sd-tauri-core"
version = "2.0.0"
version = "2.0.0-alpha.1"
edition = "2021"
[dependencies]

View File

@@ -1,6 +1,6 @@
[package]
name = "spacedrive"
version = "2.0.0"
version = "2.0.0-alpha.1"
edition = "2021"
[[bin]]

View File

@@ -1,6 +1,6 @@
{
"productName": "Spacedrive",
"version": "2.0.0-pre.1",
"version": "2.0.0-alpha.1",
"identifier": "com.spacedrive.desktop",
"build": {
"beforeDevCommand": "bun run dev:with-daemon",

View File

@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "sd-core"
version = "2.0.0-pre.1"
version = "2.0.0-alpha.1"
autobins = true
[features]

View File

@@ -131,7 +131,7 @@ The rewrite wasn't a failure of the team. It was the natural outcome of explorin
## V2 Rewrite (2025)
V2 was rebuilt over 4 months by the founder using AI-accelerated development, systematically addressing every failure from V1. Each architectural decision directly solves a specific problem that made V1 unmaintainable.
V2 has been rebuilt by the founder using AI-accelerated development, systematically addressing every failure from V1. Each architectural decision directly solves a specific problem that made V1 unmaintainable.
### Infrastructure: No More Deprecated Dependencies

206
xtask/src/bump.rs Normal file
View File

@@ -0,0 +1,206 @@
use anyhow::{Context, Result};
use std::path::{Path, PathBuf};
use std::process::Command;
enum FileType {
CargoToml,
Json,
}
/// All files that contain the Spacedrive product version
fn version_files(root: &Path) -> Vec<(PathBuf, FileType)> {
vec![
(root.join("core/Cargo.toml"), FileType::CargoToml),
(root.join("apps/server/Cargo.toml"), FileType::CargoToml),
(root.join("apps/cli/Cargo.toml"), FileType::CargoToml),
(
root.join("apps/tauri/src-tauri/Cargo.toml"),
FileType::CargoToml,
),
(
root.join("apps/tauri/sd-tauri-core/Cargo.toml"),
FileType::CargoToml,
),
(
root.join("apps/tauri/src-tauri/tauri.conf.json"),
FileType::Json,
),
(root.join("apps/tauri/package.json"), FileType::Json),
]
}
fn validate_version(version: &str) -> Result<()> {
let core = version.split('-').next().unwrap_or(version);
let parts: Vec<&str> = core.split('.').collect();
if parts.len() != 3 {
anyhow::bail!(
"Invalid version: '{}'. Expected format: X.Y.Z or X.Y.Z-pre.N",
version
);
}
for part in &parts {
part.parse::<u32>()
.context(format!("Invalid version number: '{}'", part))?;
}
Ok(())
}
fn update_cargo_toml(content: &str, new_version: &str) -> Result<(String, String)> {
let mut lines: Vec<String> = content.lines().map(|l| l.to_string()).collect();
let mut old_version = String::new();
let mut in_package = false;
let mut found = false;
for line in &mut lines {
let trimmed = line.trim();
if trimmed == "[package]" {
in_package = true;
continue;
}
if trimmed.starts_with('[') {
in_package = false;
continue;
}
if in_package && !found {
if let Some(rest) = trimmed.strip_prefix("version") {
let rest = rest.trim();
if let Some(rest) = rest.strip_prefix('=') {
let rest = rest.trim();
if rest.starts_with('"') && rest.ends_with('"') {
old_version = rest[1..rest.len() - 1].to_string();
*line = line.replace(
&format!("\"{}\"", old_version),
&format!("\"{}\"", new_version),
);
found = true;
}
}
}
}
}
if !found {
anyhow::bail!("Could not find version in [package] section");
}
let mut result = lines.join("\n");
if content.ends_with('\n') {
result.push('\n');
}
Ok((result, old_version))
}
fn update_json(content: &str, new_version: &str) -> Result<(String, String)> {
let mut lines: Vec<String> = content.lines().map(|l| l.to_string()).collect();
let mut old_version = String::new();
let mut found = false;
for line in &mut lines {
let trimmed = line.trim();
if !found && trimmed.starts_with("\"version\"") {
if let Some(colon_pos) = trimmed.find(':') {
let after_colon = trimmed[colon_pos + 1..].trim();
let version_str = after_colon.trim_end_matches(',');
if version_str.starts_with('"') && version_str.ends_with('"') {
old_version = version_str[1..version_str.len() - 1].to_string();
*line = line.replace(
&format!("\"{}\"", old_version),
&format!("\"{}\"", new_version),
);
found = true;
}
}
}
}
if !found {
anyhow::bail!("Could not find \"version\" field");
}
let mut result = lines.join("\n");
if content.ends_with('\n') {
result.push('\n');
}
Ok((result, old_version))
}
pub fn bump(root: &Path, new_version: &str) -> Result<()> {
validate_version(new_version)?;
println!("Bumping version to {}...", new_version);
println!();
for (path, file_type) in version_files(root) {
let relative = path.strip_prefix(root).unwrap_or(&path);
if !path.exists() {
println!("{} (not found, skipping)", relative.display());
continue;
}
let content = std::fs::read_to_string(&path)
.context(format!("Failed to read {}", relative.display()))?;
let (new_content, old_version) = match file_type {
FileType::CargoToml => update_cargo_toml(&content, new_version)?,
FileType::Json => update_json(&content, new_version)?,
};
if content != new_content {
std::fs::write(&path, &new_content)
.context(format!("Failed to write {}", relative.display()))?;
println!(
"{} ({}{})",
relative.display(),
old_version,
new_version
);
} else {
println!(" - {} (already {})", relative.display(), new_version);
}
}
// Commit version changes and create git tag
let tag = format!("v{}", new_version);
let files: Vec<String> = version_files(root)
.into_iter()
.filter(|(p, _)| p.exists())
.map(|(p, _)| p.to_string_lossy().to_string())
.collect();
let mut add_args = vec!["add".to_string()];
add_args.extend(files);
Command::new("git")
.args(&add_args)
.current_dir(root)
.status()
.context("Failed to stage version files")?;
Command::new("git")
.args(["commit", "-m", &tag])
.current_dir(root)
.status()
.context("Failed to create commit")?;
Command::new("git")
.args(["tag", &tag])
.current_dir(root)
.status()
.context("Failed to create tag")?;
println!();
println!("Committed and tagged {}. Push with:", tag);
println!(" git push --tags");
Ok(())
}

View File

@@ -24,6 +24,7 @@
//! - Cross-platform by default
//! - No external tools required (except cargo/rustup)
mod bump;
mod config;
mod native_deps;
mod system;
@@ -67,6 +68,7 @@ fn main() -> Result<()> {
eprintln!(" build-ios Build sd-ios-core XCFramework for iOS devices and simulator");
eprintln!(" build-mobile Build sd-mobile-core for React Native iOS/Android");
eprintln!(" test-core Run all core integration tests with progress tracking");
eprintln!(" bump <ver> Bump version across all packages (e.g. bump 2.0.0-alpha.2)");
eprintln!();
eprintln!("Examples:");
eprintln!(" cargo xtask setup # First time setup");
@@ -88,6 +90,15 @@ fn main() -> Result<()> {
.unwrap_or(false);
test_core_command(verbose)?;
}
"bump" => {
let version = args.get(2).cloned().unwrap_or_else(|| {
eprintln!("Usage: cargo xtask bump <version>");
eprintln!("Example: cargo xtask bump 2.0.0-alpha.2");
std::process::exit(1);
});
let root = find_workspace_root()?;
bump::bump(&root, &version)?;
}
_ => {
eprintln!("Unknown command: {}", args[1]);
eprintln!("Run 'cargo xtask' for usage information.");