Added scripts for building and release making

This commit is contained in:
2024-09-19 18:09:47 +03:00
parent 7d6d560d2b
commit affafed441
5 changed files with 140 additions and 184 deletions

17
scripts/build-release.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/bash
if [[ -z "$1" ]]; then
echo "Please suppy a version: 0.0.0[a | b | rc-0]"
exit
fi
set -e
cargo build --release --target x86_64-pc-windows-gnu
cargo build --release --target x86_64-unknown-linux-gnu
cargo build --release --target aarch64-unknown-linux-gnu
cp ./target/x86_64-pc-windows-gnu/release/mcmg.exe ./target/mcmg_win32.exe
cp ./target/x86_64-unknown-linux-gnu/release/mcmg ./target/mcmg_linux_x86_64
cp ./target/aarch64-unknown-linux-gnu/release/mcmg ./target/mcmg_linux_aarch64
cp ./scripts/setup-template.sh "./target/mcmg-setup-$1.sh"

42
scripts/setup-template.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/bash
set -e
PROG_VER=$(echo $0 | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+([ab]|(rc[-]*[0-9]*))")
echo $PROG_VER
function cmd_exists() {
if ! command -v $1 &> /dev/null
then
return 1
else
return 0
fi
}
if cmd_exists "pacman"; then
if cmd_exists "yay"; then
yay -Sy --needed ffmpeg yt-dlp spotdl curl
else
sudo pacman -Sy --needed ffmpeg yt-dlp python python-pip python-pipx curl
pipx install spotdl
fi
fi
if cmd_exists "apt"; then
sudo apt-get update
sudo apt-get install python3 python3-pip ffmpeg curl
# updates all python packages, uncomment if you get errors for packages
# pip3 freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
python3 -m pip install --upgrade pip
python3 -m pip install spotdl
python3 -m pip install yt-dlp
fi
curl "https://git.mcorangehq.xyz/XOR64/music/releases/download/${PROG_VER}/mcmg_linux_x86_64" -o mcmg