diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 15d782b..f01dbf3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,6 +35,7 @@ jobs: ${{ runner.os }}-flatpak-builder- - run: just ci + - run: rm -rf .flatpak-builder/build # Save caches - name: Save Flatpak dependencies 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..5bb006f 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 env CARGO_HOME=/run/build/clapgrep/cargo cargo --offline fmt --all -- --check --verbose echo Check code: - ./build-aux/fun.sh cargo check + ./build-aux/fun.sh env CARGO_HOME=/run/build/clapgrep/cargo 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 env CARGO_HOME=/run/build/clapgrep/cargo 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