-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce justfile for building locally
- Loading branch information
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/.idea | ||
/.vscode | ||
/target | ||
/artifacts | ||
**/artifacts | ||
.intentionally-empty-file.o | ||
|
||
*.swp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Define variables | ||
artifacts_dir := "artifacts" | ||
target_dir := "../target" | ||
package_name := "identity-server" | ||
targets := ("x86_64-unknown-linux-musl" | ||
+ "aarch64-unknown-linux-musl" | ||
+ "x86_64-pc-windows-gnu" | ||
+ "aarch64-apple-darwin") | ||
|
||
default: all | ||
|
||
# Build Rust binaries for different targets | ||
rust-build: | ||
cargo-zigbuild build --profile artifact -p {{package_name}} --target aarch64-apple-darwin --target x86_64-pc-windows-gnu --target aarch64-unknown-linux-musl --target x86_64-unknown-linux-musl | ||
|
||
# Copy artifacts from cargo target dir into to the artifacts directory | ||
artifacts: rust-build | ||
pwd | ||
mkdir -p {{artifacts_dir}} | ||
cp {{target_dir}}/aarch64-apple-darwin/artifact/{{package_name}} {{artifacts_dir}}/{{package_name}}-macos-aarch64 | ||
cp {{target_dir}}/x86_64-unknown-linux-musl/artifact/{{package_name}} {{artifacts_dir}}/{{package_name}}-linux-x86_64 | ||
cp {{target_dir}}/aarch64-unknown-linux-musl/artifact/{{package_name}} {{artifacts_dir}}/{{package_name}}-linux-aarch64 | ||
cp {{target_dir}}/x86_64-pc-windows-gnu/artifact/{{package_name}}.exe {{artifacts_dir}}/{{package_name}}-windows-x86_64.exe | ||
|
||
# Build Docker image | ||
podman: artifacts | ||
podman build --platform linux/arm64,linux/amd64,windows/amd64 . | ||
|
||
# Clean artifacts | ||
clean: | ||
rm -rf {{artifacts_dir}} | ||
|
||
# Run all tasks | ||
all: rust-build artifacts podman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[toolchain] | ||
channel = "1.81.0" # See workspace Cargo.toml | ||
channel = "1.82.0" # See workspace Cargo.toml | ||
components = ["rust-src"] | ||
profile = "default" | ||
targets = ["x86_64-pc-windows-gnu", "x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl", "aarch64-apple-darwin"] |