Skip to content

Commit 81dfacc

Browse files
committed
init: initial commit with TraceView core features
1 parent 3231c12 commit 81dfacc

31 files changed

+8182
-2
lines changed

.github/workflows/cd.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: CD
2+
3+
on:
4+
release:
5+
types:
6+
- created # Trigger this workflow when a new release is created
7+
8+
jobs:
9+
# Build and release binaries for Linux and Windows
10+
linux_windows:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
checks: write
15+
16+
actions: read
17+
issues: read
18+
packages: write
19+
pull-requests: read
20+
repository-projects: read
21+
statuses: read
22+
steps:
23+
- name: Checkout the repository
24+
uses: actions/checkout@v2 # Checkout the repository to the runner
25+
26+
- name: Install Linux and Windows Cross Compilers
27+
run: sudo apt-get install --yes --no-install-recommends musl-tools gcc-mingw-w64-x86-64-win32 # Install necessary cross-compilers for Linux and Windows
28+
29+
- name: Install rustup targets
30+
run: rustup target add x86_64-unknown-linux-musl x86_64-pc-windows-gnu
31+
32+
- name: Build the executable
33+
run: cargo build --release --target x86_64-unknown-linux-musl --target x86_64-pc-windows-gnu # Build the executable for both Linux and Windows targets
34+
35+
- name: Build release name
36+
run: |
37+
PKG_NAME=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].name')
38+
PKG_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
39+
RELEASE_NAME="${PKG_NAME}_${PKG_VERSION}"
40+
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
41+
42+
- name: Tar x86_64 binary
43+
run: |
44+
PKG_NAME=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].name')
45+
tar -czvf ${{ env.RELEASE_NAME }}-gnu-linux-x86_64.tar.gz -C target/x86_64-unknown-linux-musl/release ${PKG_NAME}
46+
47+
- name: Zip windows binary
48+
run: |
49+
PKG_NAME=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].name')
50+
zip -j ${{ env.RELEASE_NAME }}-windows.zip target/x86_64-pc-windows-gnu/release/${PKG_NAME}.exe
51+
52+
- name: Generate SHA256 checksums
53+
run: |
54+
shasum -a 256 ${{ env.RELEASE_NAME }}-gnu-linux-x86_64.tar.gz > ${{ env.RELEASE_NAME }}-gnu-linux-x86_64.tar.gz.sha256
55+
shasum -a 256 ${{ env.RELEASE_NAME }}-windows.zip > ${{ env.RELEASE_NAME }}-windows.zip.sha256
56+
57+
- name: Upload release binaries
58+
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # Use the third party action to upload the release binaries
59+
env:
60+
GITHUB_TOKEN: ${{ github.token }} # Use the GitHub token for authentication
61+
with:
62+
files: |
63+
${{ env.RELEASE_NAME }}-gnu-linux-x86_64.tar.gz
64+
${{ env.RELEASE_NAME }}-windows.zip
65+
${{ env.RELEASE_NAME }}-gnu-linux-x86_64.tar.gz.sha256
66+
${{ env.RELEASE_NAME }}-windows.zip.sha256
67+
68+
# Build and release binaries for MacOS (x86_64 and arm64)
69+
macos:
70+
runs-on: macos-latest
71+
permissions:
72+
contents: write
73+
checks: write
74+
75+
actions: read
76+
issues: read
77+
packages: write
78+
pull-requests: read
79+
repository-projects: read
80+
statuses: read
81+
steps:
82+
- name: Checkout the repository
83+
uses: actions/checkout@v2
84+
85+
- name: Install rustup targets
86+
run: rustup target add x86_64-apple-darwin aarch64-apple-darwin
87+
88+
- name: Build the executable
89+
run: cargo build --release --target=x86_64-apple-darwin --target=aarch64-apple-darwin
90+
91+
- name: Build release name
92+
run: |
93+
PKG_NAME=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].name')
94+
PKG_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
95+
RELEASE_NAME="${PKG_NAME}_${PKG_VERSION}"
96+
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
97+
- name: Tar x86_64 binary
98+
run: |
99+
PKG_NAME=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].name')
100+
tar -czvf ${{ env.RELEASE_NAME }}-macos-x86_64.tar.gz -C target/x86_64-apple-darwin/release ${PKG_NAME}
101+
102+
- name: Tar arm64 binary
103+
run: |
104+
PKG_NAME=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].name')
105+
tar -czvf ${{ env.RELEASE_NAME }}-macos-aarch64.tar.gz -C target/aarch64-apple-darwin/release ${PKG_NAME}
106+
107+
- name: Generate SHA256 checksums
108+
run: |
109+
shasum -a 256 ${{ env.RELEASE_NAME }}-macos-x86_64.tar.gz > ${{ env.RELEASE_NAME }}-macos-x86_64.tar.gz.sha256
110+
shasum -a 256 ${{ env.RELEASE_NAME }}-macos-aarch64.tar.gz > ${{ env.RELEASE_NAME }}-macos-aarch64.tar.gz.sha256
111+
112+
- name: Upload release binaries
113+
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda
114+
env:
115+
GITHUB_TOKEN: ${{ github.token }}
116+
with:
117+
files: |
118+
${{ env.RELEASE_NAME }}-macos-x86_64.tar.gz
119+
${{ env.RELEASE_NAME }}-macos-aarch64.tar.gz
120+
${{ env.RELEASE_NAME }}-macos-x86_64.tar.gz.sha256
121+
${{ env.RELEASE_NAME }}-macos-aarch64.tar.gz.sha256
122+
# crates:
123+
# runs-on: ubuntu-latest
124+
# needs: [linux_windows, macos]
125+
# steps:
126+
# - name: Publish to crates.io
127+
# - uses: actions/checkout@v3
128+
# - uses: actions-rs/toolchain@v1
129+
# with:
130+
# toolchain: stable
131+
# override: true
132+
# - uses: katyo/publish-crates@v2
133+
# with:
134+
# registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main", "feature-**", "patch-**" ]
6+
pull_request:
7+
branches: [ "main", "feature-**", "patch-**" ]
8+
paths-ignore:
9+
- 'LICENSE'
10+
- 'README.md'
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
15+
jobs:
16+
build_and_test:
17+
name: Build and test
18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
strategy:
22+
matrix:
23+
os:
24+
- ubuntu-latest
25+
- macos-latest
26+
- windows-latest
27+
runs-on: ${{ matrix.os }}
28+
steps:
29+
- run: git config --global core.autocrlf false
30+
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Update local toolchain
35+
run: |
36+
rustup update
37+
38+
- name: Toolchain info
39+
run: |
40+
cargo --version --verbose
41+
rustc --version
42+
cargo clippy --version
43+
44+
- name: Check and format
45+
run: |
46+
cargo fmt
47+
cargo clippy
48+
49+
- name: Run tests
50+
run: |
51+
cargo check
52+
cargo test --all
53+
54+
- name: Build
55+
run: |
56+
cargo build --release
57+
58+

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish to crates.io
2+
3+
on:
4+
workflow_dispatch: # Trigger this workflow manually
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
steps:
13+
- name: Checkout the repository
14+
uses: actions/checkout@v2 # Checkout the repository to the runner
15+
16+
- name: Update local toolchain
17+
run: |
18+
rustup update
19+
20+
- name: Toolchain info
21+
run: |
22+
rustup --version
23+
24+
- name: Publish to crates.io
25+
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} # Publish the crate to crates.io

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/).
7+
8+
---
9+
10+
## [1.0.0] - 2025-02-20
11+
### Added
12+
- 🚀 Initial release of the `TraceView` application.
13+
- 📂 Filesystem explorer: Navigate the local filesystem with ease.
14+
- 📊 System overview: View real-time system resource usage (CPU, memory, disk).
15+
- 🔎 File and directory search: Search for files and directories by name.
16+
- 📝 Export functionality: Save search results as a JSON file.
17+
- 🛠️ Configurable settings via a `config.toml` file.
18+
- 🗂️ Metadata retrieval: View metadata for files and directories (size, permissions, last modified, and more).
19+
- ❓ Comprehensive help page accessible within the application.
20+
21+
### Fixed
22+
- N/A (Initial release)
23+
24+
### Changed
25+
- N/A

Cargo.toml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[package]
2+
name = "traceview"
3+
authors = ["javaLux"]
4+
version = "1.0.0"
5+
edition = "2021"
6+
description = "Tracing and viewing your files and resource landscape"
7+
license = "MIT"
8+
repository = "https://github.com/javaLux/traceview"
9+
readme = "README.md"
10+
keywords = ["file-explorer", "tui", "cli"]
11+
categories = ["command-line-utilities"]
12+
rust-version = "1.74.0"
13+
14+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
15+
16+
#Common dependencies ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
17+
[dependencies]
18+
anyhow = "1.0.96"
19+
clap = { version = "4.5.30", features = ["derive", "cargo", "string"] }
20+
crossterm = { version = "0.28.1", default-features = false, features = ["event-stream", "serde"] }
21+
ratatui = "0.29.0"
22+
tokio = { version = "1.43.0", default-features = false, features = ["macros", "time", "rt-multi-thread", "fs"] }
23+
tokio-util = "0.7.13"
24+
futures = "0.3.31"
25+
path-absolutize = "3.1.1"
26+
serde = { version = "1.0.218", default-features = false, features = ["serde_derive"] }
27+
serde_json = "1.0.139"
28+
log = "0.4.25"
29+
os_info = { version = "3.10.0", default-features = false }
30+
simplelog = "0.12.2"
31+
chrono = "0.4.39"
32+
sysinfo = "0.33.1"
33+
walkdir = "2.5.0"
34+
async-trait = "0.1.86"
35+
file-format = {version = "0.26.0", features = ["reader"]}
36+
dirs = "6.0.0"
37+
confy = "0.6.1"
38+
console = "0.15.10"
39+
copypasta = "0.10.1"
40+
human_bytes = {version = "0.4.3", default-features = false}
41+
42+
43+
[profile.release]
44+
# compiler optimizations for binary size
45+
opt-level = "s"
46+
# link optimizations -> causes a longer link time but produce better optimize code
47+
lto = true
48+
# strip either symbols or debug info from the final binary
49+
strip = true

0 commit comments

Comments
 (0)