Selaa lähdekoodia

Merge pull request #334 from eza-community/cafk-cross-musl

build(cross): more compile targets
Christina Sørensen 2 vuotta sitten
vanhempi
sitoutus
f23ff86fbe
1 muutettua tiedostoa jossa 52 lisäystä ja 21 poistoa
  1. 52 21
      Justfile

+ 52 - 21
Justfile

@@ -109,36 +109,67 @@ all-release: build-release test-release
     sleep 10
     gh pr create --draft --title "chore: release $(grep '^version' Cargo.toml | head -n 1 | grep -E '([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?' -o)" --body "This PR was auto-generated by our lovely just file" --reviewer cafkafk 
 
-# If you're not cafkafk and she isn't dead, you probably don't need to run
-# this!
+#----------------#
+#    binaries    #
+#----------------#
+
+tar BINARY TARGET:
+    tar czvf ./target/"bin-$(convco version)"/{{BINARY}}_{{TARGET}}.tar.gz -C ./target/{{TARGET}}/release/ ./{{BINARY}}
+
+zip BINARY TARGET:
+    zip -j ./target/"bin-$(convco version)"/{{BINARY}}_{{TARGET}}.zip ./target/{{TARGET}}/release/{{BINARY}}
+
+binary BINARY TARGET:
+    rustup target add {{TARGET}}
+    cross build --release --target {{TARGET}}
+    just tar {{BINARY}} {{TARGET}}
+    just zip {{BINARY}} {{TARGET}}
+
+checksum:
+    echo "# Checksums"
+    echo "## sha256sum"
+    echo '```'
+    sha256sum ./target/"bin-$(convco version)"/*
+    echo '```'
+    echo "## md5sum"
+    echo '```'
+    md5sum ./target/"bin-$(convco version)"/*
+    echo '```'
+
+alias c := cross
+
+# Generate release binaries for EZA
 # 
 # usage: cross
 @cross: 
-    rustup toolchain install stable
+    # Setup Output Directory
     mkdir -p ./target/"bin-$(convco version)"
 
-    # Build
+    # Install Toolchains/Targets
+    rustup toolchain install stable
+
     ## Linux
-    cross build --target x86_64-unknown-linux-gnu --release
-    tar czvf ./target/"bin-$(convco version)"/eza_x86_64-unknown-linux-gnu.tar.gz -C ./target/x86_64-unknown-linux-gnu/release/ ./eza
-    cross build --target aarch64-unknown-linux-gnu --release
-    tar czvf ./target/"bin-$(convco version)"/eza_aarch64-unknown-linux-gnu.tar.gz -C ./target/aarch64-unknown-linux-gnu/release/ ./eza
-    cross build --target arm-unknown-linux-gnueabihf --release
-    tar czvf ./target/"bin-$(convco version)"/arm-unknown-linux-gnueabihf.tar.gz -C ./target/arm-unknown-linux-gnueabihf/release/ ./eza
+    ### x86
+    just binary eza x86_64-unknown-linux-gnu
+    just binary eza x86_64-unknown-linux-musl
+
+    ### aarch
+    just binary eza aarch64-unknown-linux-gnu
+
+    ### arm
+    just binary eza arm-unknown-linux-gnueabihf
+
+    ## MacOS
+    # TODO: just binary eza x86_64-apple-darwin
+
     ## Windows
-    cross build --target x86_64-pc-windows-gnu --release
-    zip -j ./target/"bin-$(convco version)"/x86_64-pc-windows-gnu.zip ./target/x86_64-pc-windows-gnu/release/eza.exe
+    ### x86
+    just binary eza.exe x86_64-pc-windows-gnu
+    # TODO: just binary eza.exe x86_64-pc-windows-gnullvm
+    # TODO: just binary eza.exe x86_64-pc-windows-msvc
 
     # Generate Checksums
-    echo "# Checksums"
-    echo "## sha256sum"
-    echo "```"
-    sha256sum ./target/"bin-$(convco version)"/*
-    echo "```"
-    echo "## md5sum"
-    echo "```"
-    md5sum ./target/"bin-$(convco version)"/*
-    echo "```"
+    just checksum
 
 #---------------------#
 # Integration testing #