From 5f8facbd4602e476e70d74ed59f42ca9dbe8a050 Mon Sep 17 00:00:00 2001 From: Stanislav Pastushenko Date: Thu, 11 Dec 2025 19:43:47 +0100 Subject: [PATCH] build fix? --- .gitea/workflows/build.yml | 32 +++++++++++++++++++++++--------- Cargo.lock | 2 +- Cargo.toml | 2 +- docker/linux-build.Dockerfile | 9 +++++++-- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 6f99e61..2303a7f 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -38,22 +38,36 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Generate dependency hash + id: deps_hash + run: | + # Create a hash of dependencies only (excludes package version) + # This prevents cache invalidation on version bumps + { + # Get all dependencies from Cargo.toml (skip package.version) + grep -A 9999 '^\[dependencies' Cargo.toml 2>/dev/null || true + grep -A 9999 '^\[dev-dependencies' Cargo.toml 2>/dev/null || true + grep -A 9999 '^\[build-dependencies' Cargo.toml 2>/dev/null || true + # Include Cargo.lock for exact dependency versions + cat Cargo.lock 2>/dev/null || true + } | sha256sum | cut -d' ' -f1 > /tmp/deps_hash.txt + echo "hash=$(cat /tmp/deps_hash.txt)" >> $GITHUB_OUTPUT + - name: Cache Cargo Dependencies - uses: actions/cache@v3 + uses: https://gitea.com/actions/cache@v3 with: # Path to cache: The 'target' directory contains all compiled libraries path: | - ~/.cargo/bin/ - ~/.cargo/registry/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ target/ - # Key: Changes if OS, Rust toolchain, or dependencies change - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.target }} - # Restore Keys: Use for finding a cache from a slightly older lock file + # Key: Changes only when dependencies change, not when version changes + key: ${{ runner.os }}-cargo-${{ steps.deps_hash.outputs.hash }}-${{ matrix.target }} + # Restore Keys: Fallback to any cache for this target restore-keys: | - ${{ runner.os }}-cargo-${{ matrix.target }}- + ${{ runner.os }}-cargo-${{ steps.deps_hash.outputs.hash }}- ${{ runner.os }}-cargo- - env: - GHA_TAR_PATH: /usr/bin/tar - name: Setup cross-compilation tools if: matrix.setup_cmd != '' diff --git a/Cargo.lock b/Cargo.lock index fc22288..f695e4e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2706,7 +2706,7 @@ dependencies = [ [[package]] name = "rlogg" -version = "0.3.0" +version = "0.3.1" dependencies = [ "chrono", "eframe", diff --git a/Cargo.toml b/Cargo.toml index 253e148..07224a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rlogg" -version = "0.3.0" +version = "0.3.1" edition = "2024" authors = ["Stanislav Pastushenko "] description = "A fast log file viewer with search, filtering, and highlighting capabilities" diff --git a/docker/linux-build.Dockerfile b/docker/linux-build.Dockerfile index babb05d..40a1c5d 100644 --- a/docker/linux-build.Dockerfile +++ b/docker/linux-build.Dockerfile @@ -1,3 +1,8 @@ FROM rust:latest -RUN apt update && \ - apt install -y nodejs npm tar \ No newline at end of file +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + nodejs \ + npm \ + tar \ + gzip \ + && rm -rf /var/lib/apt/lists/* \ No newline at end of file