update build scripts

This commit is contained in:
2025-07-12 00:22:52 +03:00
parent eacfaaf8f6
commit 22c5ca6384
9 changed files with 54 additions and 19 deletions
+1 -1
View File
@@ -38,6 +38,6 @@ depends = "libX11"
[package.metadata.generate-rpm]
assets = [
{ source = "target/release/pwsp", dest = "/usr/bin/pwsp", mode = "755" },
{ source = "target/x86_64-unknown-linux-gnu/release/pwsp", dest = "/usr/bin/pwsp", mode = "755" },
{ source = "pwsp.desktop", dest = "/usr/share/applications/pwsp.desktop", mode = "644" }
]
-4
View File
@@ -1,4 +0,0 @@
#!/usr/bin/sh
rustup target add x86_64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-gnu
-4
View File
@@ -1,4 +0,0 @@
#!/usr/bin/sh
sh ./build_deb.sh
sh ./build_rpm.sh
-5
View File
@@ -1,5 +0,0 @@
#!/usr/bin/sh
sh ./build.sh
cargo install cargo-deb
cargo deb
-5
View File
@@ -1,5 +0,0 @@
#!/usr/bin/sh
sh ./build.sh
cargo install cargo-generate-rpm
cargo generate-rpm
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/bash
# Change dir to the cargo project
cd "$(dirname "$(realpath "$0")")/.." || exit
RUST_TARGET=${1:-"x86_64-unknown-linux-gnu"}
rustup target add "$RUST_TARGET"
cargo build --release --target "$RUST_TARGET"
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/bash
# Change dir to the cargo project
cd "$(dirname "$(realpath "$0")")/.." || exit
RUST_TARGET="x86_64-unknown-linux-gnu"
# Build all packages
bash ./build_scripts/build_deb.sh "$RUST_TARGET"
bash ./build_scripts/build_rpm.sh "$RUST_TARGET"
# Move .deb and .rpm packages to for_github_release directory
mkdir ./target/for_github_release
cp "$(find ./target/$RUST_TARGET/debian/pwsp_*_amd64.deb | sort -V | tail -n 1)" ./target/for_github_release/
cp "$(find ./target/generate-rpm/pwsp-*.x86_64.rpm | sort -V | tail -n 1)" ./target/for_github_release/
# Compress binaries using upx (if upx is installed)
if command -v upx >/dev/null 2>&1; then
upx --best ./target/$RUST_TARGET/release/pwsp
upx -t ./target/$RUST_TARGET/release/pwsp
fi
# Move binaries to for_github_release directory
cp ./target/$RUST_TARGET/release/pwsp ./target/for_github_release/pwsp-x86_64-linux-gnu
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/bash
# Change dir to the cargo project
cd "$(dirname "$(realpath "$0")")/.." || exit
RUST_TARGET=${1:-"x86_64-unknown-linux-gnu"}
bash ./build_scripts/build.sh "$RUST_TARGET"
cargo install cargo-deb
cargo deb --target "$RUST_TARGET"
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/bash
# Change dir to the cargo project
cd "$(dirname "$(realpath "$0")")/.." || exit
RUST_TARGET=${1:-"x86_64-unknown-linux-gnu"}
bash ./build_scripts/build.sh "$RUST_TARGET"
cargo install cargo-generate-rpm
cargo generate-rpm