From a31908e72b72c4fd40b4eaabcfecb4db0dda8154 Mon Sep 17 00:00:00 2001 From: Leopold Luley Date: Mon, 9 Sep 2024 22:40:18 +0200 Subject: [PATCH] meta: Another attempt at fixing the CI. --- build-aux/Makefile | 3 ++- build-aux/fun.sh | 1 + justfile | 14 +++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/build-aux/Makefile b/build-aux/Makefile index c0a20a3..c07af24 100644 --- a/build-aux/Makefile +++ b/build-aux/Makefile @@ -2,7 +2,8 @@ .PHONY: all all: cat po/LINGUAS | while read lang; do mkdir -p assets/locale/$$lang/LC_MESSAGES; msgfmt -o assets/locale/$$lang/LC_MESSAGES/de.leopoldluley.Clapgrep.mo po/$$lang.po; done - cargo build --package clapgrep-gnome --release + cargo --offline fetch --manifest-path Cargo.toml --verbose + cargo --offline build --package clapgrep-gnome --release mkdir -p /app/share/locale install -Dm0755 target/release/clapgrep-gnome /app/bin/clapgrep install -Dm0755 assets/de.leopoldluley.Clapgrep.desktop /app/share/applications/de.leopoldluley.Clapgrep.desktop diff --git a/build-aux/fun.sh b/build-aux/fun.sh index 513c7d3..b215a7b 100755 --- a/build-aux/fun.sh +++ b/build-aux/fun.sh @@ -1,3 +1,4 @@ #!/usr/bin/env sh +export CARGO_HOME=/run/build/clapgrep/cargo flatpak-builder --run $(dirname $0)/../flatpak $(dirname $0)/de.leopoldluley.Clapgrep.json "$@" diff --git a/justfile b/justfile index d3e2fa8..1ee13b4 100644 --- a/justfile +++ b/justfile @@ -33,6 +33,10 @@ clean: build *args: build-translations cargo build --package {{frontend}} {{args}} +build-offline *args: build-translations + cargo --offline fetch --manifest-path Cargo.toml --verbose + cargo --offline build --package {{frontend}} {{args}} + check *args: cargo clippy --all-features {{args}} @@ -40,13 +44,13 @@ run *args: build-translations env RUST_BACKTRACE=full cargo run --package {{frontend}} {{args}} ci: setup-flatpak-repos - flatpak-builder --delete-build-dirs --disable-updates --build-only --ccache --force-clean flatpak build-aux/{{appid}}.json + flatpak-builder --keep-build-dirs --disable-updates --build-only --ccache --force-clean flatpak build-aux/{{appid}}.json echo Check formatting: - ./build-aux/fun.sh cargo fmt --all -- --check --verbose + ./build-aux/fun.sh cargo --offline fmt --all -- --check --verbose echo Check code: - ./build-aux/fun.sh cargo check + ./build-aux/fun.sh cargo --offline check echo Check code with Clippy: - ./build-aux/fun.sh cargo clippy --workspace --all-targets --all-features -- -D warnings + ./build-aux/fun.sh cargo --offline clippy --workspace --all-targets --all-features -- -D warnings install: mkdir -p {{po-dst}} @@ -60,7 +64,7 @@ make-makefile: echo "# This file was generated by 'just make-makefile'" > build-aux/Makefile echo ".PHONY: all" >> build-aux/Makefile echo "all:" >> build-aux/Makefile - just -n build --release 2>&1 | sed 's/^/\t/' | sed 's/\$/$$/g' >> build-aux/Makefile + just -n build-offline --release 2>&1 | sed 's/^/\t/' | sed 's/\$/$$/g' >> build-aux/Makefile just -n --set prefix /app install 2>&1 | sed 's/^/\t/' >> build-aux/Makefile prepare-flatpak: make-makefile