From e77c30d351a1adfeac6354c050987a9eb87f4b78 Mon Sep 17 00:00:00 2001 From: Leo Borai Date: Sat, 8 Aug 2026 18:35:14 +0200 Subject: [PATCH] chore: update gh action to use `just` --- .editorconfig | 6 +++--- .github/workflows/build.yml | 3 ++- .github/workflows/clippy.yml | 3 ++- .github/workflows/fmt.yml | 3 ++- .github/workflows/release.yml | 8 +++++--- .github/workflows/test.yml | 4 ++-- Justfile | 24 ++++++++++++------------ README.md | 8 ++++---- src/file-explorer-ui/Justfile | 23 +++++++++++++++++++++++ src/file-explorer-ui/Makefile | 17 ----------------- src/http-server/Justfile | 26 ++++++++++++++++++++++++++ src/http-server/Makefile | 20 -------------------- test/Justfile | 14 ++++++++++++++ test/Makefile | 10 ---------- 14 files changed, 95 insertions(+), 74 deletions(-) create mode 100644 src/file-explorer-ui/Justfile delete mode 100644 src/file-explorer-ui/Makefile create mode 100644 src/http-server/Justfile delete mode 100644 src/http-server/Makefile create mode 100644 test/Justfile delete mode 100644 test/Makefile diff --git a/.editorconfig b/.editorconfig index 9385cf38..c88e9a1c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ root = true -[Makefile] -indent_style = tab -indent_size = 2 +[Justfile] +indent_style = space +indent_size = 4 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56cd2da6..60290a1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,6 +42,7 @@ jobs: - name: Install Rust Binaries run: | + cargo binstall -y --force just cargo binstall -y --force leptosfmt cargo binstall -y --force trunk @@ -52,4 +53,4 @@ jobs: sudo apt-get install -y gcc-aarch64-linux-gnu - name: Build - run: make release TARGET=${{ matrix.target }} + run: just release ${{ matrix.target }} diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index fc08e9cd..83359be7 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -23,11 +23,12 @@ jobs: - name: Install Rust Binaries run: | + cargo binstall -y --force just cargo binstall -y --force leptosfmt cargo binstall -y --force trunk - name: Release - run: make release + run: just release - name: Run Clippy run: cargo clippy --all-targets --all-features -- -D warnings diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index df3d94a7..e6331ce2 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -25,11 +25,12 @@ jobs: - name: Install Rust Binaries run: | + cargo binstall -y --force just cargo binstall -y --force leptosfmt cargo binstall -y --force trunk - name: Release - run: make release + run: just release - name: Run run: cargo fmt --all -- --check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97f4b323..2061c25a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,11 +45,12 @@ jobs: - name: Install Rust Binaries run: | cargo binstall -y --force cargo-edit + cargo binstall -y --force just cargo binstall -y --force leptosfmt cargo binstall -y --force trunk - name: Build (debug) - run: make build + run: just build - name: publish crate run: | @@ -103,6 +104,7 @@ jobs: - name: Install Rust Binaries run: | cargo binstall -y --force cargo-tag + cargo binstall -y --force just cargo binstall -y --force leptosfmt cargo binstall -y --force trunk @@ -120,7 +122,7 @@ jobs: fi - name: Build binary - run: make release TARGET=${{ matrix.target }} + run: just release ${{ matrix.target }} - name: Package binary run: | @@ -195,7 +197,7 @@ jobs: cargo binstall -y --force trunk - name: Prep Assets and Binary - run: make release + run: just release - name: Publish crate run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb454f16..f92f7f88 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,9 +36,9 @@ jobs: - name: Install Rust Binaries run: | + cargo binstall -y --force just cargo binstall -y --force leptosfmt cargo binstall -y --force trunk - name: Run Tests - run: | - TARGET=$(rustc --version --verbose | grep host | cut -d' ' -f2) make test + run: just test diff --git a/Justfile b/Justfile index 7a7487f7..e3a00c7e 100644 --- a/Justfile +++ b/Justfile @@ -8,39 +8,39 @@ default: just --list # Build (debug) -build: - make -C ./src/file-explorer-ui dist - make -C ./src/http-server build TARGET={{target}} +build target=target: + just --justfile ./src/file-explorer-ui/Justfile --working-directory ./src/file-explorer-ui dist + just --justfile ./src/http-server/Justfile --working-directory ./src/http-server build {{target}} # Build (release) -release: - make -C ./src/file-explorer-ui release - make -C ./src/http-server release TARGET={{target}} +release target=target: + just --justfile ./src/file-explorer-ui/Justfile --working-directory ./src/file-explorer-ui release + just --justfile ./src/http-server/Justfile --working-directory ./src/http-server release {{target}} # Run http-server run: - make -C ./src/http-server run + just --justfile ./src/http-server/Justfile --working-directory ./src/http-server run # Build File Explorer UI (release) ui-build: - make -C ./src/file-explorer-ui release + just --justfile ./src/file-explorer-ui/Justfile --working-directory ./src/file-explorer-ui release # Run File Explorer UI dev server ui-dev: @echo Starting File Explorer UI… - make -C ./src/file-explorer-ui dev + just --justfile ./src/file-explorer-ui/Justfile --working-directory ./src/file-explorer-ui dev # Format File Explorer UI ui-fmt: - make -C ./src/file-explorer-ui fmt + just --justfile ./src/file-explorer-ui/Justfile --working-directory ./src/file-explorer-ui fmt # Build File Explorer UI (release) ui-release: - make -C ./src/file-explorer-ui release + just --justfile ./src/file-explorer-ui/Justfile --working-directory ./src/file-explorer-ui release # Run tests test: - make -C ./test run + just --justfile ./test/Justfile --working-directory ./test run # Runs the Development-Kit Container dkc: diff --git a/README.md b/README.md index d066540c..9f2d914c 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ Build release binaries with: ```bash -make release +just release ``` -Optionally you can build for other targets by specifying the `TARGET` variable +Optionally you can build for other targets by passing the target triple ```bash -make release TARGET= +just release ``` For example: @@ -42,7 +42,7 @@ For example: # Install aarch64-unknown-linux-gnu target rustup target install aarch64-unknown-linux-gnu # Build for aarch64-unknown-linux-gnu target -make release TARGET=aarch64-unknown-linux-gnu +just release aarch64-unknown-linux-gnu ``` Then use the following _alias_ for convenience diff --git a/src/file-explorer-ui/Justfile b/src/file-explorer-ui/Justfile new file mode 100644 index 00000000..1586135b --- /dev/null +++ b/src/file-explorer-ui/Justfile @@ -0,0 +1,23 @@ +set dotenv-load +set positional-arguments + +# List Tasks +default: + just --list + +# Run dev server +dev: + trunk serve --config ./Trunk.toml + +# Build (debug) +dist: + trunk build --config ./Trunk.toml + +# Format +fmt: + @leptosfmt --version >/dev/null 2>&1 || (echo "Error: leptosfmt is required."; exit 1) + @leptosfmt ./src/**/*.rs + +# Build (release) +release: + trunk build --release --locked --config ./Trunk.toml diff --git a/src/file-explorer-ui/Makefile b/src/file-explorer-ui/Makefile deleted file mode 100644 index 48aa114a..00000000 --- a/src/file-explorer-ui/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -.PHONY: default - -default: - @echo No default target. - -dev: - trunk serve --config ./Trunk.toml - -dist: - trunk build --config ./Trunk.toml - -fmt: - @leptosfmt --version >/dev/null 2>&1 || (echo "Error: leptosfmt is required."; exit 1) - @leptosfmt ./src/**/*.rs - -release: - trunk build --release --locked --config ./Trunk.toml diff --git a/src/http-server/Justfile b/src/http-server/Justfile new file mode 100644 index 00000000..9e837b7d --- /dev/null +++ b/src/http-server/Justfile @@ -0,0 +1,26 @@ +set dotenv-load +set positional-arguments + +target := `rustc --version --verbose | grep host | cut -d' ' -f2` + +# List Tasks +default: + cargo r -- start + +# Build (debug) +build target=target: + @echo "Building for target: {{target}}" + cargo b --target {{target}} + +# Build (release) +release target=target: + @echo "Building with release mode for target: {{target}}" + cargo b --release --target {{target}} + +# Build File Explorer UI (debug) +dist: + just --justfile ../file-explorer-ui/Justfile --working-directory ../file-explorer-ui dist + +# Run http-server +run: dist + cargo r -- start diff --git a/src/http-server/Makefile b/src/http-server/Makefile deleted file mode 100644 index d7e655a1..00000000 --- a/src/http-server/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -TARGET ?= $(shell rustc --version --verbose | grep host | cut -d' ' -f2) - -.PHONY: default - -default: - cargo r -- start - -build: - @echo "Building for target: $(TARGET)" - cargo b --target $(TARGET) - -release: - @echo "Building with release mode for target: $(TARGET)" - cargo b --release --target $(TARGET) - -dist: - make -C ../file-explorer-ui dist - -run: dist - cargo r -- start diff --git a/test/Justfile b/test/Justfile new file mode 100644 index 00000000..f37884fe --- /dev/null +++ b/test/Justfile @@ -0,0 +1,14 @@ +set dotenv-load +set positional-arguments + +# List Tasks +default: + just --list + +# Run tests +run: build + cargo test + +# Build release artifacts +build: + just --justfile ../Justfile --working-directory ../ release diff --git a/test/Makefile b/test/Makefile deleted file mode 100644 index d25399ea..00000000 --- a/test/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -.PHONY: default - -default: - @echo No default target. - -run: build - cargo test - -build: - make -C ../ release