mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-09 09:49:10 +02:00
Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
670d92c8b5 |
||
|
|
ffce919049 |
||
|
|
df080b4c55 |
8 changed files with 103 additions and 89 deletions
6
.github/dependabot.yml
vendored
Normal file
6
.github/dependabot.yml
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
90
.github/workflows/ci.yml
vendored
90
.github/workflows/ci.yml
vendored
|
|
@ -1,90 +1,86 @@
|
|||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- "v*.x"
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '30 3 * * 2'
|
||||
|
||||
name: CI
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
test:
|
||||
name: run tests
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
rust: [1.54, stable]
|
||||
toolchain: [stable, 1.54]
|
||||
include:
|
||||
- platform: windows-latest
|
||||
exe_suffix: .exe
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: actions/checkout@v5
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
override: true
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
- run: mkdir artifacts
|
||||
- name: Build with default features
|
||||
uses: actions-rs/cargo@v1
|
||||
run: |
|
||||
cargo build
|
||||
cp target/debug/tldr${{ matrix.exe_suffix}} artifacts/tldr-default${{ matrix.exe_suffix}}
|
||||
- name: Build with logging
|
||||
run: |
|
||||
cargo build --features logging --no-default-features
|
||||
cp target/debug/tldr${{ matrix.exe_suffix}} artifacts/tldr-logging${{ matrix.exe_suffix}}
|
||||
- uses: actions/upload-artifact@v5
|
||||
with:
|
||||
command: build
|
||||
- name: Build with all features
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --all-features
|
||||
name: tldr-debug-build-${{ matrix.platform }}-rust-${{ matrix.toolchain }}
|
||||
path: artifacts/
|
||||
- name: Run tests
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all-features
|
||||
run: cargo test -- --test-threads 1
|
||||
|
||||
clippy:
|
||||
name: run clippy lints
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
components: clippy
|
||||
override: true
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --all-features
|
||||
- uses: actions/checkout@v5
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
components: clippy
|
||||
- name: run clippy lints
|
||||
run: cargo clippy --features logging
|
||||
|
||||
fmt:
|
||||
name: run rustfmt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.54
|
||||
override: true
|
||||
- run: rustup component add rustfmt
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
- uses: actions/checkout@v5
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
components: rustfmt
|
||||
- name: run rustfmt
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
docs:
|
||||
name: build docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v5
|
||||
- name: Setup mdBook
|
||||
uses: peaceiris/actions-mdbook@v1
|
||||
uses: peaceiris/actions-mdbook@v2
|
||||
with:
|
||||
mdbook-version: '0.4.4'
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
toolchain: stable
|
||||
- name: Build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
run: cargo build
|
||||
- name: Ensure that docs can be built
|
||||
run: cd docs && mdbook build
|
||||
- name: Generate usage string
|
||||
|
|
|
|||
15
.github/workflows/gh-pages.yml
vendored
15
.github/workflows/gh-pages.yml
vendored
|
|
@ -1,25 +1,24 @@
|
|||
name: github pages
|
||||
|
||||
name: GitHub Pages
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "v[1-9]*" # push events matching `v` followed by anything larger than 0, e.g. v1.0, v20.15.10
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Setup mdBook
|
||||
uses: peaceiris/actions-mdbook@v1
|
||||
uses: peaceiris/actions-mdbook@v2
|
||||
with:
|
||||
mdbook-version: '0.4.4'
|
||||
|
||||
- run: cd docs && mdbook build
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./docs/book
|
||||
|
|
|
|||
73
.github/workflows/release.yml
vendored
73
.github/workflows/release.yml
vendored
|
|
@ -1,3 +1,4 @@
|
|||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
|
|
@ -5,41 +6,41 @@ on:
|
|||
|
||||
jobs:
|
||||
create-release:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v5
|
||||
- name: Create release for tag
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
source ./scripts/upload-asset.sh
|
||||
# Create: <token> <repo> <tag>
|
||||
create_release ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${GITHUB_REF#refs/*/} "Tealdeer version ${GITHUB_REF#refs/*/v}.\n\nFor the full changelog, see https://github.com/dbrgn/tealdeer/blob/main/CHANGELOG.md.\n\nBinaries were generated automatically in CI, and are therefore unsigned. For a fully trusted release, please build from source."
|
||||
create_release ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${GITHUB_REF#refs/*/} "Tealdeer version ${GITHUB_REF#refs/*/v}.\n\nFor the full changelog, see https://github.com/tealdeer-rs/tealdeer/blob/main/CHANGELOG.md.\n\nBinaries were generated automatically in CI, and are therefore unsigned. For a fully trusted release, please build from source."
|
||||
|
||||
upload-completions:
|
||||
needs:
|
||||
- create-release
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
target: ["bash", "fish", "zsh"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v5
|
||||
- name: Upload completion
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
source ./scripts/upload-asset.sh
|
||||
# Upload: <token> <repo> <tag> <file> <name>
|
||||
upload_release_file ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${GITHUB_REF#refs/*/} ${{ matrix.target }}_tealdeer completions_${{ matrix.target }}
|
||||
upload_release_file ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${GITHUB_REF#refs/*/} completion/${{ matrix.target }}_tealdeer completions_${{ matrix.target }}
|
||||
|
||||
upload-license:
|
||||
needs:
|
||||
- create-release
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
target: ["MIT", "APACHE"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v5
|
||||
- name: Upload license
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
|
|
@ -48,12 +49,14 @@ jobs:
|
|||
upload_release_file ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${GITHUB_REF#refs/*/} LICENSE-${{ matrix.target }} LICENSE-${{ matrix.target }}.txt
|
||||
|
||||
build-linux:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- arch: "x86_64"
|
||||
libc: "musl"
|
||||
- arch: "aarch64"
|
||||
libc: "musl"
|
||||
- arch: "i686"
|
||||
libc: "musl"
|
||||
- arch: "armv7"
|
||||
|
|
@ -63,42 +66,50 @@ jobs:
|
|||
- arch: "arm"
|
||||
libc: "musleabihf"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v5
|
||||
- name: Pull Docker image
|
||||
run: docker pull messense/rust-musl-cross:${{ matrix.arch }}-${{ matrix.libc }}
|
||||
- name: Build in Docker
|
||||
run: docker run --rm -i -v "$(pwd)":/home/rust/src messense/rust-musl-cross:${{ matrix.arch }}-${{ matrix.libc }} cargo build --release
|
||||
- name: Strip binary
|
||||
run: docker run --rm -i -v "$(pwd)":/home/rust/src messense/rust-musl-cross:${{ matrix.arch }}-${{ matrix.libc }} musl-strip -s /home/rust/src/target/${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}/release/tldr
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: "tealdeer-linux-${{ matrix.arch }}-${{ matrix.libc }}"
|
||||
path: "target/${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}/release/tldr"
|
||||
|
||||
build-macos:
|
||||
runs-on: macos-11
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- arch: "x86_64"
|
||||
- arch: "aarch64"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v5
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: "${{ matrix.arch }}-apple-darwin"
|
||||
- name: Build
|
||||
uses: actions-rs/cargo@v1
|
||||
run: cargo build --release --target ${{ matrix.arch }}-apple-darwin
|
||||
- uses: actions/upload-artifact@v5
|
||||
with:
|
||||
command: build
|
||||
args: --release --target x86_64-apple-darwin
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: "tealdeer-macos-x86_64"
|
||||
path: "target/x86_64-apple-darwin/release/tldr"
|
||||
name: "tealdeer-macos-${{ matrix.arch }}"
|
||||
path: "target/${{ matrix.arch }}-apple-darwin/release/tldr"
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-2022
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
uses: actions-rs/cargo@v1
|
||||
- uses: actions/checkout@v5
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
command: build
|
||||
args: --release --target x86_64-pc-windows-msvc
|
||||
- uses: actions/upload-artifact@v2
|
||||
toolchain: stable
|
||||
- name: Build
|
||||
run: cargo build --release --target x86_64-pc-windows-msvc
|
||||
- uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: "tealdeer-windows-x86_64-msvc"
|
||||
path: "target/x86_64-pc-windows-msvc/release/tldr.exe"
|
||||
|
|
@ -109,20 +120,22 @@ jobs:
|
|||
- build-linux
|
||||
- build-macos
|
||||
- build-windows
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- linux-x86_64-musl
|
||||
- linux-aarch64-musl
|
||||
- linux-i686-musl
|
||||
- linux-armv7-musleabihf
|
||||
- linux-arm-musleabi
|
||||
- linux-arm-musleabihf
|
||||
- macos-x86_64
|
||||
- macos-aarch64
|
||||
- windows-x86_64-msvc
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/download-artifact@v2
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/download-artifact@v6
|
||||
- name: Upload binary
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
|
|
|
|||
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -1275,7 +1275,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tealdeer"
|
||||
version = "1.5.0"
|
||||
version = "1.5.1"
|
||||
dependencies = [
|
||||
"ansi_term",
|
||||
"app_dirs2",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ name = "tealdeer"
|
|||
readme = "README.md"
|
||||
repository = "https://github.com/dbrgn/tealdeer/"
|
||||
documentation = "https://dbrgn.github.io/tealdeer/"
|
||||
version = "1.5.0"
|
||||
version = "1.5.1"
|
||||
include = ["/src/**/*", "/tests/**/*", "/Cargo.toml", "/README.md", "/LICENSE-*", "/screenshot.png", "/bash_tealdeer", "/fish_tealdeer"]
|
||||
edition = "2018"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
tealdeer 1.5.0
|
||||
tealdeer 1.5.1
|
||||
Danilo Bargen <mail@dbrgn.ch>, Niklas Mohrin <dev@niklasmohrin.de>
|
||||
A fast TLDR client
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ const APP_INFO: AppInfo = AppInfo {
|
|||
name: NAME,
|
||||
author: NAME,
|
||||
};
|
||||
const ARCHIVE_URL: &str = "https://tldr.sh/assets/tldr.zip";
|
||||
const ARCHIVE_URL: &str = "https://github.com/tldr-pages/tldr/releases/latest/download/tldr.zip";
|
||||
|
||||
// Note: flag names are specified explicitly in clap attributes
|
||||
// to improve readability and allow contributors to grep names like "clear-cache"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue