Add cargo-deb metadata (#409)

This commit is contained in:
Ajeet D'Souza 2022-06-26 00:37:44 +05:30 committed by GitHub
parent 10c11310ed
commit 7c7a2a0a3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 82 additions and 6 deletions

View File

@ -1,2 +1,7 @@
[alias]
xtask = "run --package xtask --"
# On Windows MSVC, statically link the C runtime so that the resulting EXE does
# not depend on the vcruntime DLL.
[target.'cfg(all(windows, target_env = "msvc"))']
rustflags = ["-C", "target-feature=+crt-static"]

View File

@ -2,7 +2,6 @@ name: release
on:
push:
branches: [main]
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
pull_request:
workflow_dispatch:
@ -21,12 +20,14 @@ jobs:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
deb: true
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
deb: true
- os: macos-11
target: x86_64-apple-darwin
@ -71,6 +72,20 @@ jobs:
args: --release --locked --target=${{ matrix.target }} --color=always --verbose
use-cross: ${{ runner.os == 'Linux' }}
- name: Install cargo-deb
if: ${{ matrix.deb == true }}
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-deb --locked
- name: Build deb
if: ${{ matrix.deb == true }}
uses: actions-rs/cargo@v1
with:
command: deb
args: --no-build --no-strip --output=. --target=${{ matrix.target }}
- name: Package (*nix)
if: runner.os != 'Windows'
run: >
@ -94,14 +109,18 @@ jobs:
with:
name: ${{ matrix.target }}
path: |
*.zip
*.deb
*.tar.gz
*.zip
- name: Create release
if: startsWith(github.ref, 'refs/tags/v')
if: startsWith(github.event.head_commit.message, 'chore(release)')
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
*.zip
*.deb
*.tar.gz
*.zip
name: ${{ github.event.head_commit.id }}
tag_name: ""

View File

@ -3,9 +3,11 @@ authors = ["Ajeet D'Souza <98ajeet@gmail.com>"]
categories = ["command-line-utilities", "filesystem"]
description = "A smarter cd command for your terminal"
edition = "2021"
homepage = "https://github.com/ajeetdsouza/zoxide"
keywords = ["cli"]
license = "MIT"
name = "zoxide"
readme = "README.md"
repository = "https://github.com/ajeetdsouza/zoxide"
rust-version = "1.59"
version = "0.8.1"
@ -60,3 +62,53 @@ codegen-units = 1
debug = 0
lto = true
strip = true
[package.metadata.deb]
assets = [
[
"target/release/zoxide",
"usr/local/bin/",
"755",
],
[
"contrib/completions/zoxide.bash",
"usr/share/bash-completion/completions/zoxide",
"644",
],
[
"contrib/completions/zoxide.fish",
"usr/share/fish/completions/",
"664",
],
[
"contrib/completions/_zoxide",
"usr/share/zsh/vendor-completions/",
"644",
],
[
"man/man1/*",
"usr/share/man/man1/",
"644",
],
[
"README.md",
"usr/share/doc/zoxide/",
"644",
],
[
"CHANGELOG.md",
"usr/share/doc/zoxide/",
"644",
],
[
"LICENSE",
"usr/share/doc/zoxide/",
"644",
],
]
extended-description = """\
zoxide is a smarter cd command, inspired by z and autojump. It remembers which \
directories you use most frequently, so you can "jump" to them in just a few \
keystrokes."""
priority = "optional"
section = "admin"

View File

@ -113,14 +113,14 @@ end
{%- match cmd %}
{%- when Some with (cmd) %}
abbr --erase {{cmd}}
abbr --erase {{cmd}} &>/dev/null
complete -c {{cmd}} -e
function {{cmd}}
__zoxide_z $argv
end
complete -c {{cmd}} -f -a '(__zoxide_z_complete)'
abbr --erase {{cmd}}i
abbr --erase {{cmd}}i &>/dev/null
complete -c {{cmd}}i -e
function {{cmd}}i
__zoxide_zi $argv