Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"package-name": "mmt",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the mmt was the old name, and this should be mmtui. Ignore it if I am wrong.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right but that name only figures here. I don't think it is worth it to change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't checked but assumed it influences the package name: mmtui_mmt-v0.2.0_amd64_ubuntu-22.04.deb. I have no issue with it already updated the package based on this name, just wanted to highlight.

"release-type": "rust",
"extra-files": [
{
"path": "README.md",
"type": "generic"
}
]
}
}
}
3 changes: 3 additions & 0 deletions .github/release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.0"
}
88 changes: 88 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI

on:
push:
branches: [main, master]
pull_request: {}

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -C debuginfo=0

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Check formatting
run: cargo fmt --all --check
- name: Run Clippy
run: cargo clippy --all -- -D warnings

release_please:
name: Release Management
needs: [check]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: actions/checkout@v4
- name: Create Release
id: release
uses: googleapis/release-please-action@v4
with:
config-file: .github/release-please-config.json
manifest-file: .github/release-please-manifest.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
name: Publish for ${{ matrix.os }}
needs: release_please
if: ${{ needs.release_please.outputs.release_created == 'true' }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y dh-make

- name: Install cargo-deb
run: cargo install cargo-deb

- name: Build and Package
run: |
cargo deb -v

VERSION="${{ needs.release_please.outputs.tag_name }}"
VERSION=${VERSION#v}
mv target/debian/*.deb "./target/mmt_${VERSION}_amd64_${{ matrix.os }}.deb"
cd target/release
tar -czf "../../target/mmt_${VERSION}_amd64_${{ matrix.os }}.tar.gz" mmt

- name: Upload Release Artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload --clobber ${{ needs.release_please.outputs.tag_name }} \
./target/*.deb \
./target/*.tar.gz
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mmtui"
version = "0.1.1"
version = "0.2.0"
edition = "2021"
authors = ["Lutsai Aleksandr <s.lyra@ya.ru>"]
description = "Terminal User Interface disk mount manager for TUI file managers"
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async fn main() -> udisks2::Result<()> {
loop {
if let Ok(drv) = drives::collect_all(&config).await {
s.lock().await.clone_from(&drv);
};
}
tokio::time::sleep(Duration::from_millis(500)).await;
}
});
Expand All @@ -53,7 +53,7 @@ async fn main() -> udisks2::Result<()> {

if key.kind == KeyEventKind::Press {
match tui.input(key).await {
InputResult::None => continue,
InputResult::None => {}
InputResult::Quit => break,
InputResult::QuitChangeDirectory(p) => {
output_change_path = p;
Expand Down
10 changes: 2 additions & 8 deletions src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ use ratatui::{
layout::{Alignment, Constraint, Layout},
style::Color,
text::Line,
widgets::{
Block, BorderType, Padding, Paragraph, Row, Table, TableState, Widget, Wrap,
},
widgets::{Block, BorderType, Padding, Paragraph, Row, Table, TableState, Widget, Wrap},
Frame,
};

Expand Down Expand Up @@ -132,11 +130,7 @@ impl Tui {
.row_highlight_style(Color::Green)
.highlight_symbol(">");

frame.render_stateful_widget(
table,
block.inner(layout[0]),
&mut self.ts,
);
frame.render_stateful_widget(table, block.inner(layout[0]), &mut self.ts);

let descr = match &self.selected {
Some(s) => {
Expand Down