From df080b4c55edf3d012be38137ffa86fb626f80e7 Mon Sep 17 00:00:00 2001 From: Niklas Mohrin Date: Sat, 24 Jan 2026 00:06:19 +0100 Subject: [PATCH 1/3] Update .github files Checked out b3cd7b1c216656ea3416a86104363589157477dc and performed minor edits. --- .github/dependabot.yml | 6 +++ .github/workflows/ci.yml | 90 ++++++++++++++++------------------ .github/workflows/gh-pages.yml | 15 +++--- .github/workflows/release.yml | 73 +++++++++++++++------------ 4 files changed, 99 insertions(+), 85 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8ac6b8c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 390e565..19f5198 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index c32ec71..8746d42 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0a7f1c..539f2ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: - 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: - 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: | From ffce919049795ad6ae1977ec0438c44390ae7137 Mon Sep 17 00:00:00 2001 From: Niklas Mohrin Date: Sat, 24 Jan 2026 00:00:20 +0100 Subject: [PATCH 2/3] Update `ARCHIVE_URL` When this code was written, the client specification instructed clients that they MUST download pages from the tldr.sh domain. However, this domain was deprecated and shut down in December 2025. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e6d79df..b959f6e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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" From 670d92c8b5a3d4843b60c5f715e097a084b617ec Mon Sep 17 00:00:00 2001 From: Niklas Mohrin Date: Sat, 24 Jan 2026 00:52:36 +0100 Subject: [PATCH 3/3] Release v1.5.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- docs/src/usage.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c55e8f..10ec150 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1275,7 +1275,7 @@ dependencies = [ [[package]] name = "tealdeer" -version = "1.5.0" +version = "1.5.1" dependencies = [ "ansi_term", "app_dirs2", diff --git a/Cargo.toml b/Cargo.toml index 22c9ca3..40cbf47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/docs/src/usage.txt b/docs/src/usage.txt index 8e7ae5b..68ba0f4 100644 --- a/docs/src/usage.txt +++ b/docs/src/usage.txt @@ -1,4 +1,4 @@ -tealdeer 1.5.0 +tealdeer 1.5.1 Danilo Bargen , Niklas Mohrin A fast TLDR client