Skip to content

Commit fa1a04d

Browse files
committed
Fix scripts
1 parent f7c27ae commit fa1a04d

3 files changed

Lines changed: 52 additions & 30 deletions

File tree

.github/actions/build-installers/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ runs:
1717
steps:
1818
- name: Download JDKs
1919
run: bash download-jdks.sh ${{ inputs.os }} ${{ inputs.arch }}
20+
working-directory: installers
2021
shell: bash
2122

2223
- name: Build installers
2324
run: bash build-installers.sh ${{ inputs.tag }} ${{ inputs.os }} ${{ inputs.arch }}
25+
working-directory: installers
2426
shell: bash

installers/build-installers.sh

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
set -e # Quit on Error
1111

12-
inno_setup_url="https://files.jrsoftware.org/is/6/innosetup-6.5.1.exe"
12+
inno_setup_url="https://github.com/jrsoftware/issrc/releases/download/is-6_7_3/innosetup-6.7.3.exe"
1313

1414
function build_nbpackage {
15-
echo ">> Building the nbpackage installer for $1-$2"
15+
echo ">> Building the NBPackage installer for $1-$2"
1616

17-
./nbpackage/nbpackage-$nbpackage_version/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config "$1-$2/$3" --output ../dist/ -v -Ppackage.version="$4"
17+
./nbpackage/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config "$1-$2/$3" --output ../dist/ -v -Ppackage.version="$4"
1818

1919
echo "<< OK!"
2020
}
@@ -23,18 +23,17 @@ function build_nbpackage {
2323
function build_linux_deb {
2424
echo "> Building the Linux DEB"
2525

26-
build_nbpackage linux x64 jmonkeyengine-x64-deb.properties "$1"
27-
build_nbpackage linux aarch64 jmonkeyengine-aarch64-deb.properties "$1"
26+
build_nbpackage linux "$2" jmonkeyengine-"$2"-deb.properties "$1"
2827

2928
echo "< OK!"
3029
}
3130

3231
function build_windows_installer {
3332
echo "> Building the Windows installer"
3433

35-
setup_inno_setup "$2"
34+
setup_inno_setup
3635

37-
build_nbpackage windows x64 jmonkeyengine-windows-x64.properties "$1"
36+
build_nbpackage windows "$2" jmonkeyengine-windows-"$2".properties "$1"
3837

3938
echo "< OK!"
4039
}
@@ -43,15 +42,7 @@ function setup_inno_setup {
4342
echo ">> Setting up Inno Setup"
4443

4544
download_inno_setup
46-
47-
# Needs Wine!!!
48-
if [ -z "$1" ];
49-
then
50-
wine downloads/innosetup.exe /VERYSILENT
51-
else
52-
echo "<< Trying headless mode"
53-
xvfb-run wine downloads/innosetup.exe /VERYSILENT
54-
fi
45+
downloads/innosetup.exe /VERYSILENT
5546

5647
echo "<< OK!"
5748
}
@@ -74,13 +65,12 @@ function download_inno_setup {
7465
function build_macos_pgk {
7566
echo "> Building the MacOS pgk"
7667

77-
build_nbpackage macos x64 jmonkeyengine-macos-x64.properties "$1"
78-
build_nbpackage macos aarch64 jmonkeyengine-macos-aarch64.properties "$1"
68+
build_nbpackage macos "$2" jmonkeyengine-macos-"$2".properties "$1"
7969

8070
echo "< OK!"
8171
}
8272

83-
echo "Building installers with version tag $1 on $2 arch $3"
73+
echo "Building installers with version tag $1 on $2 architecture $3"
8474

8575
versionString=$1
8676
if [[ $versionString != [[:digit:]]* ]];
@@ -89,5 +79,23 @@ then
8979
echo "Stripped version tag to $versionString"
9080
fi
9181

92-
#build_linux_deb "$versionString"
93-
#build_windows_installer "$versionString" "$2"
82+
arch_raw="${3:-}"
83+
84+
case "$arch_raw" in
85+
X86) arch="x86" ;;
86+
X64) arch="x64" ;;
87+
ARM) arch="arm" ;;
88+
ARM64) arch="aarch64" ;;
89+
*)
90+
echo "Unknown Architecture $arch_raw. ERROR!!!"
91+
exit 1
92+
esac
93+
94+
case "$2" in
95+
Windows) build_windows_installer "$versionString" "$3" ;;
96+
Linux) build_linux_deb "$versionString" "$3" ;;
97+
macOS) build_macos_pgk "$versionString" "$3" ;;
98+
*)
99+
echo "Unknown Platform $2. ERROR!!!"
100+
exit 1
101+
esac

installers/download-jdks.sh

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,34 @@ function get_jdk_linux {
4949
function get_jdk {
5050
echo "> Getting JDK for $1-$2"
5151

52-
if [[ $1 != "windows" && $1 != "linux" && $1 != "macos" ]]; then
52+
if [[ $1 != "Windows" && $1 != "Linux" && $1 != "macOS" ]]; then
5353
echo "Unknown Platform $1. ERROR!!!"
5454
exit 1
5555
fi
5656

57+
arch_raw="${2:-}"
58+
59+
case "$arch_raw" in
60+
X86) arch="x86" ;;
61+
X64) arch="x64" ;;
62+
ARM) arch="arm" ;;
63+
ARM64) arch="aarch64" ;;
64+
*)
65+
echo "Unknown Architecture $arch_raw. ERROR!!!"
66+
exit 1
67+
esac
68+
5769
# Depends on UNPACK and thus DOWNLOAD
58-
if [ "$1" == "windows" ]; then
59-
get_jdk_windows "$2"
60-
elif [ "$1" == "linux" ]; then
61-
get_jdk_linux "$2"
62-
elif [ "$1" == "macos" ]; then
63-
get_jdk_macos "$2"
70+
if [ "$1" == "Windows" ]; then
71+
get_jdk_windows "$arch"
72+
elif [ "$1" == "Linux" ]; then
73+
get_jdk_linux "$arch"
74+
elif [ "$1" == "macOS" ]; then
75+
get_jdk_macos "$arch"
6476
fi
6577

6678
echo "< OK!"
6779
}
6880

69-
echo "Building JDK with on $1 arch $2"
70-
get_jdk $1 $2
81+
echo "Building JDK with on $1 architecture $2"
82+
get_jdk "$1" "$2"

0 commit comments

Comments
 (0)