mirror of
https://github.com/tareqimbasher/cargo-seek.git
synced 2026-01-09 07:52:41 +08:00
change bin name
This commit is contained in:
parent
629e51788d
commit
9bd01fd9f5
91
.github/workflows/cd.yml
vendored
91
.github/workflows/cd.yml
vendored
@ -4,13 +4,12 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- '[v]?[0-9]+.[0-9]+.[0-9]+'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
publish:
|
||||
|
||||
name: Publishing for ${{ matrix.os }}
|
||||
name: Publishing for ${{ matrix.os }} (${{ matrix.architecture }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
@ -19,7 +18,7 @@ jobs:
|
||||
target: x86_64-apple-darwin
|
||||
architecture: x86_64
|
||||
binary-postfix: ""
|
||||
binary-name: crate-seek
|
||||
binary-name: cargo-seek
|
||||
use-cross: false
|
||||
- os: macos-latest
|
||||
os-name: macos
|
||||
@ -27,35 +26,35 @@ jobs:
|
||||
architecture: arm64
|
||||
binary-postfix: ""
|
||||
use-cross: false
|
||||
binary-name: crate-seek
|
||||
- os: ubuntu-latest
|
||||
binary-name: cargo-seek
|
||||
- os: ubuntu-22.04
|
||||
os-name: linux
|
||||
target: x86_64-unknown-linux-gnu
|
||||
architecture: x86_64
|
||||
binary-postfix: ""
|
||||
use-cross: false
|
||||
binary-name: crate-seek
|
||||
binary-name: cargo-seek
|
||||
- os: ubuntu-22.04
|
||||
os-name: linux
|
||||
target: aarch64-unknown-linux-gnu
|
||||
architecture: arm64
|
||||
binary-postfix: ""
|
||||
use-cross: true
|
||||
binary-name: cargo-seek
|
||||
- os: windows-latest
|
||||
os-name: windows
|
||||
target: x86_64-pc-windows-msvc
|
||||
architecture: x86_64
|
||||
binary-postfix: ".exe"
|
||||
use-cross: false
|
||||
binary-name: crate-seek
|
||||
- os: ubuntu-latest
|
||||
os-name: linux
|
||||
target: aarch64-unknown-linux-gnu
|
||||
binary-name: cargo-seek
|
||||
- os: windows-latest
|
||||
os-name: windows
|
||||
target: aarch64-pc-windows-msvc
|
||||
architecture: arm64
|
||||
binary-postfix: ""
|
||||
binary-postfix: ".exe"
|
||||
use-cross: true
|
||||
binary-name: crate-seek
|
||||
- os: ubuntu-latest
|
||||
os-name: linux
|
||||
target: i686-unknown-linux-gnu
|
||||
architecture: i686
|
||||
binary-postfix: ""
|
||||
use-cross: true
|
||||
binary-name: crate-seek
|
||||
binary-name: cargo-seek
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@ -64,9 +63,7 @@ jobs:
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
@ -74,35 +71,24 @@ jobs:
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
|
||||
use-cross: ${{ matrix.use-cross }}
|
||||
|
||||
toolchain: stable
|
||||
|
||||
args: --release --target ${{ matrix.target }}
|
||||
|
||||
|
||||
- name: install strip command
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
if [[ ${{ matrix.target }} == aarch64-unknown-linux-gnu ]]; then
|
||||
|
||||
sudo apt update
|
||||
sudo apt-get install -y binutils-aarch64-linux-gnu
|
||||
fi
|
||||
- name: Packaging final binary
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
cd target/${{ matrix.target }}/release
|
||||
|
||||
|
||||
####### reduce binary size by removing debug symbols #######
|
||||
|
||||
BINARY_NAME=${{ matrix.binary-name }}${{ matrix.binary-postfix }}
|
||||
if [[ ${{ matrix.target }} == aarch64-unknown-linux-gnu ]]; then
|
||||
|
||||
GCC_PREFIX="aarch64-linux-gnu-"
|
||||
else
|
||||
GCC_PREFIX=""
|
||||
@ -110,43 +96,34 @@ jobs:
|
||||
"$GCC_PREFIX"strip $BINARY_NAME
|
||||
|
||||
########## create tar.gz ##########
|
||||
|
||||
RELEASE_NAME=${{ matrix.binary-name }}-${GITHUB_REF/refs\/tags\//}-${{ matrix.os-name }}-${{ matrix.architecture }}
|
||||
|
||||
tar czvf $RELEASE_NAME.tar.gz $BINARY_NAME
|
||||
|
||||
########## create sha256 ##########
|
||||
|
||||
if [[ ${{ runner.os }} == 'Windows' ]]; then
|
||||
|
||||
certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256
|
||||
else
|
||||
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
|
||||
fi
|
||||
- name: Releasing assets
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
draft: true
|
||||
files: |
|
||||
|
||||
target/${{ matrix.target }}/release/${{ matrix.binary-name }}-*.tar.gz
|
||||
target/${{ matrix.target }}/release/${{ matrix.binary-name }}-*.sha256
|
||||
|
||||
env:
|
||||
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
publish-cargo:
|
||||
name: Publishing to Cargo
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo publish
|
||||
env:
|
||||
|
||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
|
||||
# publish-cargo:
|
||||
# name: Publishing to Cargo
|
||||
# runs-on: ubuntu-22.04
|
||||
# steps:
|
||||
# - name: Checkout repository
|
||||
# uses: actions/checkout@v4
|
||||
# - name: Install Rust toolchain
|
||||
# uses: dtolnay/rust-toolchain@stable
|
||||
# - uses: Swatinem/rust-cache@v2
|
||||
# - run: cargo publish
|
||||
# env:
|
||||
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
|
||||
90
Cargo.lock
generated
90
Cargo.lock
generated
@ -263,6 +263,51 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cargo-seek"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"better-panic",
|
||||
"chrono",
|
||||
"clap",
|
||||
"color-eyre",
|
||||
"config",
|
||||
"crates_io_api",
|
||||
"crossterm",
|
||||
"derive_deref",
|
||||
"directories",
|
||||
"enum-iterator",
|
||||
"futures",
|
||||
"human-panic",
|
||||
"indexmap",
|
||||
"json5",
|
||||
"lazy_static",
|
||||
"num-format",
|
||||
"open",
|
||||
"pretty_assertions",
|
||||
"ratatui",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"signal-hook",
|
||||
"strip-ansi-escapes",
|
||||
"strum 0.27.1",
|
||||
"strum_macros 0.27.1",
|
||||
"sys-locale",
|
||||
"tempfile",
|
||||
"thiserror 1.0.64",
|
||||
"throbber-widgets-tui",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tracing",
|
||||
"tracing-error",
|
||||
"tracing-subscriber",
|
||||
"tui-input",
|
||||
"vergen-gix",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cargo_metadata"
|
||||
version = "0.18.1"
|
||||
@ -504,51 +549,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crate-seek"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"better-panic",
|
||||
"chrono",
|
||||
"clap",
|
||||
"color-eyre",
|
||||
"config",
|
||||
"crates_io_api",
|
||||
"crossterm",
|
||||
"derive_deref",
|
||||
"directories",
|
||||
"enum-iterator",
|
||||
"futures",
|
||||
"human-panic",
|
||||
"indexmap",
|
||||
"json5",
|
||||
"lazy_static",
|
||||
"num-format",
|
||||
"open",
|
||||
"pretty_assertions",
|
||||
"ratatui",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"signal-hook",
|
||||
"strip-ansi-escapes",
|
||||
"strum 0.27.1",
|
||||
"strum_macros 0.27.1",
|
||||
"sys-locale",
|
||||
"tempfile",
|
||||
"thiserror 1.0.64",
|
||||
"throbber-widgets-tui",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tracing",
|
||||
"tracing-error",
|
||||
"tracing-subscriber",
|
||||
"tui-input",
|
||||
"vergen-gix",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crates_io_api"
|
||||
version = "0.11.0"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "crate-seek"
|
||||
name = "cargo-seek"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "Search and install cargo crates"
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
[](https://github.com/tareqimbasher/cargo-seek/actions/workflows/ci.yml)
|
||||
|
||||
**seekr** is a fast search and management tool for rust crates.
|
||||
**cargo-seek** is a fast search and management tool for rust crates.
|
||||
|
||||
It's meant to be a quick way to search for crates on crates.io, add crates to your projects and install cargo binaries.
|
||||
|
||||
@ -28,14 +28,14 @@ It's meant to be a quick way to search for crates on crates.io, add crates to yo
|
||||
- [ ] Start by listing globally installed binaries
|
||||
|
||||
## Install
|
||||
cargo install seekr
|
||||
cargo install cargo-seek
|
||||
|
||||
## Usage
|
||||
cargo seek
|
||||
cargo-seek
|
||||
|
||||
**or**
|
||||
|
||||
seekr [SEARCHTERM]
|
||||
cargo-seek [SEARCHTERM]
|
||||
-t, --tps <FLOAT> Tick rate, i.e. number of ticks per second [default: 4]
|
||||
-f, --fps <FLOAT> Frame rate, i.e. number of frames per second [default: 30]
|
||||
--counter Show TPS/FPS counter
|
||||
|
||||
@ -19,7 +19,7 @@ pub struct AppId {
|
||||
impl AppId {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
id: format!(" 📦 seekr v{} ", env!("CARGO_PKG_VERSION")),
|
||||
id: format!(" 📦 cargo-seek v{} ", env!("CARGO_PKG_VERSION")),
|
||||
config: Config::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ pub fn get_config_dir() -> PathBuf {
|
||||
}
|
||||
|
||||
fn project_directory() -> Option<ProjectDirs> {
|
||||
ProjectDirs::from("com", "crate-seek", env!("CARGO_PKG_NAME"))
|
||||
ProjectDirs::from("com", "cargo-seek", env!("CARGO_PKG_NAME"))
|
||||
}
|
||||
|
||||
fn parse_key_event(raw: &str) -> Result<KeyEvent, String> {
|
||||
|
||||
@ -24,7 +24,7 @@ impl CrateSearchManager {
|
||||
let mut headers = header::HeaderMap::new();
|
||||
headers.insert(
|
||||
header::USER_AGENT,
|
||||
header::HeaderValue::from_str("seekr (github:tareqimbasher/seekr)")?,
|
||||
header::HeaderValue::from_str("cargo-seek (github:tareqimbasher/seekr)")?,
|
||||
);
|
||||
|
||||
let client = AsyncClient::with_http_client(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user