Skip to content

Commit

Permalink
Adjust scripts further
Browse files Browse the repository at this point in the history
Related: #11
  • Loading branch information
Hans5958 committed Nov 2, 2023
1 parent 314fa42 commit 7bc4bef
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 102 deletions.
23 changes: 14 additions & 9 deletions _script/build-1.43.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
VERSION_NUM="$(cat ../version.txt)"
BUILD_DATE=$(date +'%Y%m%d%H%M%S')
if [[ "$(python -V)" =~ "Python 3" ]]; then
PYTHON_EXECUTABLE="python"
else
PYTHON_EXECUTABLE="python3"
fi

echo "Cleaning folders..."
bash modules/clean.sh
mkdir dist

echo "Building 1.43 (development version)..."

# Preparation
echo "Preparing..."

echo "Removing temporary files..."
bash modules/clean.sh
rm -rf temp/
echo "Copying translations and other required files..."
bash modules/copy-base.sh
echo "Extracting 1.43 original files..."
7z x ../_deploy/Domino143.7z -otemp/_compile

echo "Creating compile config file..."
VERSION_NUM="$(cat ../version.txt)"
BUILD_DATE=$(date +'%Y%m%d%H%M%S')
if [[ "$(python -V)" =~ "Python 3" ]]; then
PYTHON_EXECUTABLE="python"
else
PYTHON_EXECUTABLE="python3"
fi
cat >temp/compile-config.json <<EOL
{
"resourceVersion": "1,43,$VERSION_NUM,0",
Expand All @@ -37,7 +42,7 @@ echo "Preparation done!"
# Compilation
echo "Compiling..."
bash compile-2.sh temp/compile-config.json
echo "Compile done!"
echo "Compilation done!"
# End of compilation

# Packing
Expand Down
23 changes: 14 additions & 9 deletions _script/build-1.44.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
VERSION_NUM="$(cat ../version.txt)"
BUILD_DATE=$(date +'%Y%m%d%H%M%S')
if [[ "$(python -V)" =~ "Python 3" ]]; then
PYTHON_EXECUTABLE="python"
else
PYTHON_EXECUTABLE="python3"
fi

echo "Cleaning folders..."
bash modules/clean.sh
mkdir dist

echo "Building 1.44 (development version)..."

# Preparation
echo "Preparing..."

echo "Removing temporary files..."
bash modules/clean.sh
rm -rf temp/
echo "Copying 1.43 translations and other required files..."
bash modules/copy-base.sh
echo "Copying 1.44-specific translations..."
Expand All @@ -13,13 +25,6 @@ echo "Extracting 1.44 original files..."
7z x ../_deploy/Domino144.7z -otemp/_compile

echo "Creating compile config file..."
VERSION_NUM="$(cat ../version.txt)"
BUILD_DATE=$(date +'%Y%m%d%H%M%S')
if [[ "$(python -V)" =~ "Python 3" ]]; then
PYTHON_EXECUTABLE="python"
else
PYTHON_EXECUTABLE="python3"
fi
cat >temp/compile-config.json <<EOL
{
"resourceVersion": "1,44,$VERSION_NUM,0",
Expand All @@ -39,7 +44,7 @@ echo "Preparation done!"
# Compilation
echo "Compiling..."
bash compile-2.sh temp/compile-config.json
echo "Compile done!"
echo "Compilation done!"
# End of compilation

# Packing
Expand Down
25 changes: 15 additions & 10 deletions _script/build-1.45_x64.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
VERSION_NUM="$(cat ../version.txt)"
BUILD_DATE=$(date +'%Y%m%d%H%M%S')
if [[ "$(python -V)" =~ "Python 3" ]]; then
PYTHON_EXECUTABLE="python"
else
PYTHON_EXECUTABLE="python3"
fi

echo "Cleaning folders..."
bash modules/clean.sh
mkdir dist

echo "Building 1.45 dev003 (64-bit) (development version)..."

# Preparation
echo "Preparing..."

echo "Removing temporary files..."
bash modules/clean.sh
rm -rf temp/
echo "Copying 1.43 translations and other required files..."
bash modules/copy-base.sh
echo "Copying 1.45-specific translations..."
bash modules/copy-1.45.sh
echo "Extracting 1.45 original files..."
7z x ../_deploy/Domino145_dev003_x86.7z -otemp/_compile
7z x ../_deploy/Domino145_dev003_x64.7z -otemp/_compile
7z x ../_deploy/Domino145_dev003_x64.7z -otemp/_compile -y

echo "Creating compile config file..."
VERSION_NUM="$(cat ../version.txt)"
BUILD_DATE=$(date +'%Y%m%d%H%M%S')
if [[ "$(python -V)" =~ "Python 3" ]]; then
PYTHON_EXECUTABLE="python"
else
PYTHON_EXECUTABLE="python3"
fi
cat >temp/compile-config.json <<EOL
{
"resourceVersion": "1,45,$VERSION_NUM,0",
Expand All @@ -40,7 +45,7 @@ echo "Preparation done!"
# Compilation
echo "Compiling..."
bash compile-2.sh temp/compile-config.json
echo "Compile done!"
echo "Compilation done!"
# End of compilation

# Packing
Expand Down
23 changes: 14 additions & 9 deletions _script/build-1.45_x86.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
VERSION_NUM="$(cat ../version.txt)"
BUILD_DATE=$(date +'%Y%m%d%H%M%S')
if [[ "$(python -V)" =~ "Python 3" ]]; then
PYTHON_EXECUTABLE="python"
else
PYTHON_EXECUTABLE="python3"
fi

echo "Cleaning folders..."
bash modules/clean.sh
mkdir dist

echo "Building 1.45 dev003 (32-bit) (development version)..."

# Preparation
echo "Preparing..."

echo "Removing temporary files..."
bash modules/clean.sh
rm -rf temp/
echo "Copying 1.43 translations and other required files..."
bash modules/copy-base.sh
echo "Copying 1.45-specific translations..."
Expand All @@ -13,13 +25,6 @@ echo "Extracting 1.45 original files..."
7z x ../_deploy/Domino145_dev003_x86.7z -otemp/_compile

echo "Creating compile config file..."
VERSION_NUM="$(cat ../version.txt)"
BUILD_DATE=$(date +'%Y%m%d%H%M%S')
if [[ "$(python -V)" =~ "Python 3" ]]; then
PYTHON_EXECUTABLE="python"
else
PYTHON_EXECUTABLE="python3"
fi
cat >temp/compile-config.json <<EOL
{
"resourceVersion": "1,45,$VERSION_NUM,0",
Expand All @@ -39,7 +44,7 @@ echo "Preparation done!"
# Compilation
echo "Compiling..."
bash compile-2.sh temp/compile-config.json
echo "Compile done!"
echo "Compilation done!"
# End of compilation

# Packing
Expand Down
9 changes: 4 additions & 5 deletions _script/compile-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ cd..
cmd.exe /c tmp.bat
touch $EXECUTABLE_NAME

echo "Compile done!"
echo "Compilation done!"

echo "Copying other translated files..."
rm -rf Manual
cp -r ../Manual .
cp -r ../Module .
cp -r ../System .
[ -d "Manual" ] && rm -rf Manual && cp -r ../Manual .
[ -d "Module" ] && cp -r ../Module .
[ -d "System" ] && cp -r ../System .
cp -r ../Other/* .

echo "Removing temporary files..."
Expand Down
4 changes: 2 additions & 2 deletions _script/modules/clean.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

rm -rf temp
rm -rf dist
rm -rf temp/
rm -rf dist/
41 changes: 18 additions & 23 deletions _script/workflow/build-all-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ else
PYTHON_EXECUTABLE="python3"
fi

echo "Cleaning folders..."
bash modules/clean.sh
mkdir dist

# ----------------------------------------
# 1.43

Expand All @@ -18,7 +22,7 @@ echo "::group::Prepare for compilation"
echo "Preparing..."

echo "Removing temporary files..."
bash modules/clean.sh
rm -rf temp/
echo "Copying translations and other required files..."
bash modules/copy-base.sh
echo "Extracting 1.43 original files..."
Expand Down Expand Up @@ -46,14 +50,13 @@ echo "::group::Compilation"
# Compilation
echo "Compiling..."
bash compile-2.sh temp/compile-config.json
echo "Compile done!"
echo "Compilation done!"
# End of compilation
echo "::endgroup::"

echo "::group::Pack distributable"
# Packing
echo "Packing distributable..."
mkdir dist
cd temp/_compile/
7z a ../../dist/Domino143_Translated.zip *
cd ../../
Expand All @@ -74,7 +77,9 @@ echo "::group::Prepare for compilation"
echo "Preparing..."

echo "Removing temporary files..."
rm -rf temp/_compile
rm -rf temp/
echo "Copying 1.43 translations and other required files..."
bash modules/copy-base.sh
echo "Copying 1.44-specific translations..."
bash modules/copy-1.44.sh
echo "Extracting 1.44 original files..."
Expand Down Expand Up @@ -102,14 +107,13 @@ echo "::group::Compilation"
# Compilation
echo "Compiling..."
bash compile-2.sh temp/compile-config.json
echo "Compile done!"
echo "Compilation done!"
# End of compilation
echo "::endgroup::"

echo "::group::Pack distributable"
# Packing
echo "Packing distributable..."
mkdir dist
cd temp/_compile/
7z a ../../dist/Domino144_Translated.zip *
cd ../../
Expand All @@ -130,7 +134,7 @@ echo "::group::Prepare for compilation"
echo "Preparing..."

echo "Removing temporary files..."
bash modules/clean.sh
rm -rf temp/
echo "Copying 1.43 translations and other required files..."
bash modules/copy-base.sh
echo "Copying 1.45-specific translations..."
Expand All @@ -139,19 +143,12 @@ echo "Extracting 1.45 original files..."
7z x ../_deploy/Domino145_dev003_x86.7z -otemp/_compile

echo "Creating compile config file..."
VERSION_NUM="$(cat ../version.txt)"
BUILD_DATE=$(date +'%Y%m%d%H%M%S')
if [[ "$(python -V)" =~ "Python 3" ]]; then
PYTHON_EXECUTABLE="python"
else
PYTHON_EXECUTABLE="python3"
fi
cat >temp/compile-config.json <<EOL
{
"resourceVersion": "1,45,$VERSION_NUM,0",
"fullVersion": "1.45 dev003-en.$VERSION_NUM-artifact.$BUILD_DATE",
"buildVersion": "$VERSION_NUM"-artifact.$BUILD_DATE,
"executableName": "Domino_Translated_$BUILD_DATE.exe",
"buildVersion": "$VERSION_NUM-artifact.$BUILD_DATE",
"executableName": "Domino.exe",
"compilePath": "temp/_compile",
"supplyTranslationReadme": "true",
"pythonExecutable": "$PYTHON_EXECUTABLE"
Expand All @@ -167,14 +164,13 @@ echo "::group::Compilation"
# Compilation
echo "Compiling..."
bash compile-2.sh temp/compile-config.json
echo "Compile done!"
echo "Compilation done!"
# End of compilation
echo "::endgroup::"

echo "::group::Pack distributable"
# Packing
echo "Packing distributable..."
mkdir dist
cd temp/_compile/
7z a ../../dist/Domino145_dev003_x86_Translated.zip *
cd ../../
Expand All @@ -193,22 +189,22 @@ echo "::group::Prepare for compilation"
echo "Preparing..."

echo "Removing temporary files..."
bash modules/clean.sh
rm -rf temp/
echo "Copying 1.43 translations and other required files..."
bash modules/copy-base.sh
echo "Copying 1.45-specific translations..."
bash modules/copy-1.45.sh
echo "Extracting 1.45 original files..."
7z x ../_deploy/Domino145_dev003_x86.7z -otemp/_compile
7z x ../_deploy/Domino145_dev003_x64.7z -otemp/_compile
7z x ../_deploy/Domino145_dev003_x64.7z -otemp/_compile -y

echo "Creating compile config file..."
cat >temp/compile-config.json <<EOL
{
"resourceVersion": "1,45,$VERSION_NUM,0",
"fullVersion": "1.45 dev003-en.$VERSION_NUM-artifact.$BUILD_DATE",
"buildVersion": "$VERSION_NUM-artifact.$BUILD_DATE",
"executableName": "Domino_Translated_$BUILD_DATE.exe",
"executableName": "Domino.exe",
"compilePath": "temp/_compile",
"supplyTranslationReadme": "true",
"pythonExecutable": "$PYTHON_EXECUTABLE"
Expand All @@ -224,14 +220,13 @@ echo "::group::Compilation"
# Compilation
echo "Compiling..."
bash compile-2.sh temp/compile-config.json
echo "Compile done!"
echo "Compilation done!"
# End of compilation
echo "::endgroup::"

echo "::group::Pack distributable"
# Packing
echo "Packing distributable..."
mkdir dist
cd temp/_compile/
7z a ../../dist/Domino145_dev003_x64_Translated.zip *
cd ../../
Expand Down
Loading

0 comments on commit 7bc4bef

Please sign in to comment.