diff --git a/.justfile b/.justfile index 1744558..4345748 100644 --- a/.justfile +++ b/.justfile @@ -5,24 +5,30 @@ release_mode := "dev" container_registry := "git.alecodes.page/alecodes" container_image_name := container_registry / bin_name +# Start dev server dev: watchexec --clear --restart --watch=frontend --watch=src cargo run {{ if release_mode == "prod" { "--release" } else { "" } }} +# Build the container locally build: podman build --tag {{ container_image_name }}:latest --cache-to {{ container_image_name }}-cache --cache-from {{ container_image_name }}-cache . +# Run tests test: cargo test -publish: (build) - podman push {{ container_image_name }}:latest +# Publish the project to the container registry +publish +TAGS='latest': + for tag in {{ TAGS }}; do podman push {{ container_image_name }}:latest {{ container_image_name }}:${tag}; done podman push {{ container_image_name }}:latest {{ container_image_name }}:$(git rev-parse --short HEAD) deploy: +# Delete build artifacts clean: podman system prune --build cargo clean +# Bump crate version, this will also publish it bump: cog bump --auto diff --git a/cog.toml b/cog.toml index 7d3f06a..deb24c5 100644 --- a/cog.toml +++ b/cog.toml @@ -9,6 +9,7 @@ skip_ci = "[skip ci]" skip_untracked = false pre_bump_hooks = [ "sed -E -i 's/(\"version\":) \"[0-9.]{5}\"/\\1 \"{{version|0.0.1}}\"/gi' package.json", + "just build", "just publish", "echo 'bumping from {{latest|0.0.0}} to {{version|0.0.1}}'", "cargo bump {{version|0.0.1}}",