A safe, simple, extensible, and fast agent harness
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update `cargo-dist` to package `ein-tui` as `ein` for install

+84 -12
+51 -2
.github/workflows/release.yml
··· 218 218 name: artifacts-build-plugins 219 219 path: ${{ env.ARCHIVE }} 220 220 221 + # Build and package ein-server for each platform so bootstrap.rs can download it 222 + build-server-artifacts: 223 + name: build-server-artifacts (${{ matrix.target }}) 224 + needs: 225 + - plan 226 + if: ${{ needs.plan.outputs.publishing == 'true' }} 227 + strategy: 228 + fail-fast: false 229 + matrix: 230 + include: 231 + - target: aarch64-apple-darwin 232 + runner: macos-latest 233 + - target: x86_64-apple-darwin 234 + runner: macos-13 235 + - target: x86_64-unknown-linux-gnu 236 + runner: ubuntu-22.04 237 + - target: aarch64-unknown-linux-gnu 238 + runner: ubuntu-22.04-arm 239 + runs-on: ${{ matrix.runner }} 240 + env: 241 + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 242 + steps: 243 + - uses: actions/checkout@v4 244 + with: 245 + persist-credentials: false 246 + - name: Install Rust target 247 + run: rustup target add ${{ matrix.target }} 248 + - name: Install protoc 249 + uses: arduino/setup-protoc@v3 250 + with: 251 + repo-token: ${{ secrets.GITHUB_TOKEN }} 252 + - name: Build ein-server 253 + run: cargo build --release -p ein-server --target ${{ matrix.target }} 254 + - name: Package archive 255 + shell: bash 256 + run: | 257 + TARGET="${{ matrix.target }}" 258 + ARCHIVE="ein-server-${TARGET}.tar.xz" 259 + mkdir -p dist-server 260 + cp "target/${TARGET}/release/ein-server" dist-server/ 261 + tar -cJf "${ARCHIVE}" -C dist-server ein-server 262 + echo "ARCHIVE=${ARCHIVE}" >> "$GITHUB_ENV" 263 + - name: Upload server archive artifact 264 + uses: actions/upload-artifact@v6 265 + with: 266 + name: artifacts-server-${{ matrix.target }} 267 + path: ${{ env.ARCHIVE }} 268 + 221 269 # Build and package all the platform-agnostic(ish) things 222 270 build-global-artifacts: 223 271 needs: ··· 270 318 - build-local-artifacts 271 319 - build-global-artifacts 272 320 - build-plugins 273 - # Only run if we're "publishing", and only if plan, local, global, and plugins didn't fail (skipped is fine) 274 - if: ${{ always() && needs.plan.result == 'success' && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') && (needs.build-plugins.result == 'skipped' || needs.build-plugins.result == 'success') }} 321 + - build-server-artifacts 322 + # Only run if we're "publishing", and only if plan, local, global, plugins, and server didn't fail (skipped is fine) 323 + if: ${{ always() && needs.plan.result == 'success' && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') && (needs.build-plugins.result == 'skipped' || needs.build-plugins.result == 'success') && (needs.build-server-artifacts.result == 'skipped' || needs.build-server-artifacts.result == 'success') }} 275 324 env: 276 325 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 277 326 runs-on: "ubuntu-22.04"
+21 -1
Cargo.lock
··· 1040 1040 "crossterm", 1041 1041 "dirs", 1042 1042 "ein-proto", 1043 - "flate2", 1044 1043 "notify", 1045 1044 "ratatui", 1046 1045 "reqwest", ··· 1054 1053 "tracing", 1055 1054 "tracing-appender", 1056 1055 "tracing-subscriber", 1056 + "xz2", 1057 1057 ] 1058 1058 1059 1059 [[package]] ··· 2263 2263 version = "0.1.2" 2264 2264 source = "registry+https://github.com/rust-lang/crates.io-index" 2265 2265 checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" 2266 + 2267 + [[package]] 2268 + name = "lzma-sys" 2269 + version = "0.1.20" 2270 + source = "registry+https://github.com/rust-lang/crates.io-index" 2271 + checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" 2272 + dependencies = [ 2273 + "cc", 2274 + "libc", 2275 + "pkg-config", 2276 + ] 2266 2277 2267 2278 [[package]] 2268 2279 name = "mach2" ··· 5749 5760 dependencies = [ 5750 5761 "libc", 5751 5762 "rustix 1.1.4", 5763 + ] 5764 + 5765 + [[package]] 5766 + name = "xz2" 5767 + version = "0.1.7" 5768 + source = "registry+https://github.com/rust-lang/crates.io-index" 5769 + checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" 5770 + dependencies = [ 5771 + "lzma-sys", 5752 5772 ] 5753 5773 5754 5774 [[package]]
+1 -1
Cargo.toml
··· 35 35 "x86_64-unknown-linux-gnu", 36 36 ] 37 37 pr-run-mode = "plan" 38 - members = ["crates/ein-tui", "crates/ein-server"] 38 + members = ["crates/ein-tui"] 39 39 # Allow manual edits to the generated workflow (we add a protoc install step). 40 40 allow-dirty = ["ci"] 41 41
+1 -1
crates/ein-tui/Cargo.toml
··· 35 35 tracing-appender = "0.2" 36 36 tracing-subscriber = { workspace = true } 37 37 reqwest = { version = "0.13.3", default-features = false, features = ["rustls"] } 38 - flate2 = "1.1.9" 38 + xz2 = "0.1" 39 39 tar = "0.4.45"
+10 -7
crates/ein-tui/src/bootstrap.rs
··· 9 9 #![cfg_attr(debug_assertions, allow(dead_code))] 10 10 11 11 use anyhow::{Context, Result}; 12 - use flate2::read::GzDecoder; 13 12 use std::{ 14 13 io, 15 14 os::unix::fs::PermissionsExt, 16 15 path::{Path, PathBuf}, 17 16 }; 17 + use xz2::read::XzDecoder; 18 18 use tar::Archive; 19 19 use tokio::{fs, process::Command, task}; 20 20 ··· 49 49 let ver = version.trim_start_matches('v'); 50 50 let tag = format!("v{ver}"); 51 51 let triple = target_triple(); 52 - // cargo-dist names archives as "{package}-{triple}.tar.gz" (no version in filename). 53 - let archive_name = format!("ein-server-{triple}.tar.gz"); 52 + // cargo-dist names archives as "{package}-{triple}.tar.xz" (no version in filename). 53 + let archive_name = format!("ein-server-{triple}.tar.xz"); 54 54 let url = format!("https://github.com/{GITHUB_REPO}/releases/download/{tag}/{archive_name}"); 55 55 56 56 let dest = server_bin_path(); ··· 87 87 Ok(()) 88 88 } 89 89 90 - /// Extracts the `ein-server` binary from a tar.gz archive into `dest`. 90 + /// Extracts the `ein-server` binary from a tar.xz archive into `dest`. 91 91 fn extract_server(bytes: &[u8], dest: &Path) -> Result<()> { 92 - let gz = GzDecoder::new(io::Cursor::new(bytes)); 93 - let mut archive = Archive::new(gz); 92 + let xz = XzDecoder::new(io::Cursor::new(bytes)); 93 + let mut archive = Archive::new(xz); 94 94 95 95 for entry in archive 96 96 .entries() ··· 199 199 fs::remove_file(&unit) 200 200 .await 201 201 .with_context(|| format!("failed to remove {}", unit.display()))?; 202 - steps.push(format!("Removed systemd user service ({})", SYSTEMD_SERVICE_NAME)); 202 + steps.push(format!( 203 + "Removed systemd user service ({})", 204 + SYSTEMD_SERVICE_NAME 205 + )); 203 206 } 204 207 let _ = Command::new("systemctl") 205 208 .args(["--user", "daemon-reload"])