Hybrid Mount Notify is the Telegram notification helper used by the Hybrid Mount build and release pipeline.
It scans output/ for generated ZIP artifacts, collects Git metadata from the current checkout, and sends every package to a Telegram chat or topic.
It is intentionally usable in two ways:
- as a small CLI binary for shell-based automation
- as a Rust library that can be called directly from
xtaskor other internal tooling
- Single-purpose automation for build artifact delivery.
- Low ceremony integration from shell scripts, CI workflows, or Rust code.
- Consistent metadata formatting across branch, commit, and artifact reporting.
- Small maintenance surface so it can evolve independently from the main repository.
The crate is split into two layers:
src/lib.rscontains the reusable notification logic.src/main.rsprovides a CLI wrapper around that library.
At runtime, the tool:
- reads Telegram credentials from environment variables
- scans
output/for all.zipartifacts - resolves branch and commit metadata from Git / CI environment
- uploads each archive to Telegram with an HTML caption
.
├─ src/lib.rs # reusable notification API
├─ src/main.rs # CLI entrypoint
├─ Cargo.toml # crate metadata and dependencies
├─ Cargo.lock # locked dependency graph
└─ README*.md # English and Chinese docs
Required variables:
| Key | Description |
|---|---|
TELEGRAM_BOT_TOKEN |
Telegram bot token used for upload |
TELEGRAM_CHAT_ID |
target Telegram chat id |
Optional CI metadata:
| Key | Description |
|---|---|
GITHUB_REPOSITORY |
repository shown in commit link |
GITHUB_SERVER_URL |
GitHub host base URL |
GITHUB_REF_NAME |
branch or tag name shown in caption |
If GitHub variables are missing, the crate falls back to local git commands where possible.
notify [TOPIC_ID] [EVENT_LABEL]Examples:
# use default event label
notify
# send into a Telegram topic
notify 37 "Daily Tilling - v3.4.5-123"The CLI expects the current working directory to contain an output/ folder with at least one .zip artifact. If multiple ZIP files are present, all of them are sent in sorted order.
Example:
use notify::{NotifyRequest, maybe_send_output_dir_notification};
let request = NotifyRequest::new("output", "Daily Tilling - v3.4.5-123")
.with_topic_id(Some(37));
let sent = maybe_send_output_dir_notification(&request)?;
if !sent {
eprintln!("Telegram secrets not set, skipping notification");
}Use send_output_dir_notification when missing credentials should be treated as an error, and maybe_send_output_dir_notification when callers prefer a clean skip.
Prerequisites:
- Rust stable or nightly with edition 2024 support
Commands:
# debug build
cargo build
# optimized build
cargo build --releaseLicensed under GPL-3.0.