-
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.
Replace Typescript release builder with bash
- Loading branch information
Showing
8 changed files
with
104 additions
and
452 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,4 +1,2 @@ | ||
.temp/ | ||
node_modules | ||
bun.lockb | ||
release-builder/builder |
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,4 @@ | ||
urls.txt | ||
repos | ||
zips | ||
|
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,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
lt_version=$(jq .repos.base.version ../assets/bedrock.json | tr -d '"') | ||
|
||
mkdir ./{repos,zips} | ||
|
||
cd ./zips | ||
rm -rf * | ||
cd ../repos | ||
rm -rf * | ||
|
||
function make_pack() { | ||
if [ $1 == "base" ]; then | ||
echo $1 | ||
filename=$(jq .repos.$1.filename ../../assets/bedrock.json | tr -d '"' | sed s/{version}/$lt_version/g | sed s/.mcpack//g) | ||
url=$(jq .repos.$1.url ../../assets/bedrock.json | tr -d '"') | ||
folder=$(echo $url | awk -F '/' '{print $NF}') | ||
git clone $url | ||
cd ./$folder | ||
zip -rq9 ../../zips/"$filename-source.zip" * | ||
for file in `find -name '*.png'` | ||
do | ||
oxipng -o 6 -i 1 --strip safe $file --fix | ||
done | ||
zip -rq9 ../../zips/"$filename.mcpack" * | ||
cd .. | ||
elif [ $1 == addons ]; then | ||
echo $1 $2 | ||
filename=$(jq .repos.$1[$2].filename ../../assets/bedrock.json | tr -d '"' | sed s/{version}/$lt_version/g | sed s/.mcpack//g) | ||
url=$(jq .repos.$1[$2].url ../../assets/bedrock.json | tr -d '"') | ||
folder=$(echo $url | awk -F '/' '{print $NF}') | ||
git clone $url | ||
cd ./$folder | ||
zip -rq9 ../../zips/"$filename-source.zip" * | ||
for file in `find -name '*.png'` | ||
do | ||
oxipng -o 6 -i 1 --strip safe $file --fix | ||
done | ||
zip -rq9 ../../zips/"$filename.mcpack" * | ||
cd .. | ||
fi | ||
} | ||
|
||
make_pack "base" | ||
|
||
addon_count=$(jq '.repos.addons | length' ../../assets/bedrock.json) | ||
|
||
for ((addon = 0 ; addon <= addon_count - 1 ; addon++)); do | ||
make_pack "addons" $addon | ||
done | ||
|
||
|
||
|
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,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
lt_version=$(jq .repos.base.version ../assets/java.json | tr -d '"') | ||
pack_format=$(jq .repos.base.pack_format ../assets/java.json | tr -d '"') | ||
filename=$(jq .templates.filename ../assets/java.json | tr -d '"' | sed s/{version}/$lt_version/g | sed s/{format}/$pack_format/g | sed s/-{ids}.zip//g) | ||
|
||
if [ -f ./urls.txt ]; then | ||
rm urls.txt | ||
fi | ||
|
||
grep 'github.com/Love-and-Tolerance' ../assets/java.json | while read -r line ; do | ||
url=$(echo $line | sed 's/"url": "//g' | tr -d '",') | ||
printf "$line\n" | ||
echo $url >> urls.txt | ||
done | ||
|
||
cat urls.txt | uniq >> newurls.txt | ||
mv newurls.txt urls.txt | ||
|
||
mkdir ./{repos,zips} | ||
|
||
cd ./zips | ||
rm -rf * | ||
cd ../repos | ||
rm -rf * | ||
|
||
while read url; do | ||
git clone "$url" | ||
git fetch --all | ||
git pull --all | ||
name=$(echo $url | awk -F '/' '{print $NF}') | ||
cd $name | ||
branches=$(echo $(git branch --all | grep 'remote' | grep -v " -> ") | tr " " "\n") | ||
for branch in $branches | ||
do | ||
branchname=$(echo $branch | sed 's/remotes\/origin\///g') | ||
git switch "$branchname" --discard-changes | ||
zip -rq9 ../../zips/"$filename-$name-$branchname-source.zip" * | ||
for file in `find -name '*.png'` | ||
do | ||
oxipng -o 6 -i 1 --strip safe $file --fix | ||
done | ||
zip -rq9 ../../zips/"$filename-$name-$branchname.zip" * | ||
done | ||
cd .. | ||
done < ../urls.txt | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.