Skip to content

Commit

Permalink
move duplicated code to one file, fixing bash & chmod
Browse files Browse the repository at this point in the history
  • Loading branch information
nefarius2001 committed Feb 17, 2021
1 parent 7af739f commit a94950c
Show file tree
Hide file tree
Showing 21 changed files with 56 additions and 129 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,41 +99,41 @@ jobs:
- config_name: AndroidAPK (artifact+codeql)
target_os: android
building_on_os: ubuntu-20.04
cmd1_prebuild: "sh autobuild/android/autobuild_apk_1_prepare.sh "
cmd2_build: "sh autobuild/android/autobuild_apk_2_build.sh "
cmd3_postbuild: "sh autobuild/android/autobuild_apk_3_copy_files.sh "
cmd1_prebuild: "sh ./autobuild/android/autobuild_apk_1_prepare.sh "
cmd2_build: "./autobuild/android/autobuild_apk_2_build.sh "
cmd3_postbuild: "./autobuild/android/autobuild_apk_3_copy_files.sh "
uses_codeql: true

- config_name: Linux (codeQL)
target_os: linux
building_on_os: ubuntu-20.04
cmd1_prebuild: "sh autobuild/linux/codeQL/auto_1_prepare.sh ${{ needs.create_release.outputs.x_github_workspace }}"
cmd2_build: "sh autobuild/linux/codeQL/auto_2_build_qt_project.sh"
cmd3_postbuild: "sh autobuild/linux/codeQL/auto_3_copy_files.sh"
cmd1_prebuild: "./autobuild/linux/codeQL/auto_1_prepare.sh ${{ needs.create_release.outputs.x_github_workspace }}"
cmd2_build: "./autobuild/linux/codeQL/auto_2_build_qt_project.sh"
cmd3_postbuild: "./autobuild/linux/codeQL/auto_3_copy_files.sh"
uses_codeql: true

- config_name: Linux (artifacts)
target_os: linux
building_on_os: ubuntu-20.04
cmd1_prebuild: "sh autobuild/linux/artifacts/autobuild_deb_1_prepare.sh"
cmd2_build: "sh autobuild/linux/artifacts/autobuild_deb_2_build.sh"
cmd3_postbuild: "sh autobuild/linux/artifacts/autobuild_deb_3_copy_files.sh"
cmd1_prebuild: "./autobuild/linux/artifacts/autobuild_deb_1_prepare.sh"
cmd2_build: "./autobuild/linux/artifacts/autobuild_deb_2_build.sh"
cmd3_postbuild: "./autobuild/linux/artifacts/autobuild_deb_3_copy_files.sh"
uses_codeql: false

- config_name: MacOS (codeQL)
target_os: macos
building_on_os: macos-10.15
cmd1_prebuild: "sh autobuild/mac/codeQL/autobuild_mac_1_prepare.sh"
cmd2_build: "sh autobuild/mac/codeQL/autobuild_mac_2_build.sh"
cmd3_postbuild: "sh autobuild/mac/codeQL/autobuild_mac_3_copy_files.sh"
cmd1_prebuild: "./autobuild/mac/codeQL/autobuild_mac_1_prepare.sh"
cmd2_build: "./autobuild/mac/codeQL/autobuild_mac_2_build.sh"
cmd3_postbuild: "./autobuild/mac/codeQL/autobuild_mac_3_copy_files.sh"
uses_codeql: true

- config_name: MacOS (artifacts)
target_os: macos
building_on_os: macos-10.15
cmd1_prebuild: "sh autobuild/mac/artifacts/autobuild_mac_1_prepare.sh"
cmd2_build: "sh autobuild/mac/artifacts/autobuild_mac_2_build.sh"
cmd3_postbuild: "sh autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh"
cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh"
cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh"
cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh"
uses_codeql: false

- config_name: Windows (artifact+codeql)
Expand Down
Empty file.
Empty file.
Empty file modified autobuild/android/archive___android_build_docker/install-qt.sh
100644 → 100755
Empty file.
Empty file modified autobuild/android/autobuild_apk_1_prepare.sh
100644 → 100755
Empty file.
12 changes: 1 addition & 11 deletions autobuild/android/autobuild_apk_2_build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@
### PARAMETERS ###
####################

if [ ! -z "${1}" ]; then
THIS_JAMULUS_PROJECT_PATH="${1}"
elif [ ! -z "${jamulus_project_path}" ]; then
THIS_JAMULUS_PROJECT_PATH="${jamulus_project_path}"
elif [ ! -z "${GITHUB_WORKSPACE}" ]; then
THIS_JAMULUS_PROJECT_PATH="${GITHUB_WORKSPACE}"
else
echo "Please give the path to the repository root as environment variable 'jamulus_project_path' or parameter to this script!"
exit 1
fi

source $(dirname $(readlink -f "${BASH_SOURCE[0]}"))/../ensure_THIS_JAMULUS_PROJECT_PATH.sh

###################
### PROCEDURE ###
Expand Down
12 changes: 1 addition & 11 deletions autobuild/android/autobuild_apk_3_copy_files.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@
### PARAMETERS ###
####################

if [ ! -z "${1}" ]; then
THIS_JAMULUS_PROJECT_PATH="${1}"
elif [ ! -z "${jamulus_project_path}" ]; then
THIS_JAMULUS_PROJECT_PATH="${jamulus_project_path}"
elif [ ! -z "${GITHUB_WORKSPACE}" ]; then
THIS_JAMULUS_PROJECT_PATH="${GITHUB_WORKSPACE}"
else
echo "Please give the path to the repository root as environment variable 'jamulus_project_path' or parameter to this script!"
exit 1
fi

source $(dirname $(readlink -f "${BASH_SOURCE[0]}"))/../ensure_THIS_JAMULUS_PROJECT_PATH.sh

###################
### PROCEDURE ###
Expand Down
Empty file modified autobuild/android/install-qt.sh
100644 → 100755
Empty file.
33 changes: 33 additions & 0 deletions autobuild/ensure_THIS_JAMULUS_PROJECT_PATH.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

echo "ensuring env-variable THIS_JAMULUS_PROJECT_PATH"

####################
### PARAMETERS ###
####################

if [ ! -z "${1}" ]; then
echo "THIS_JAMULUS_PROJECT_PATH from parameter"
THIS_JAMULUS_PROJECT_PATH="${1}"
elif [ ! -z "${jamulus_project_path}" ]; then
echo "THIS_JAMULUS_PROJECT_PATH from env-variable jamulus_project_path"
THIS_JAMULUS_PROJECT_PATH="${jamulus_project_path}"
elif [ ! -z "${GITHUB_WORKSPACE}" ]; then
echo "THIS_JAMULUS_PROJECT_PATH from env-variable GITHUB_WORKSPACE"
THIS_JAMULUS_PROJECT_PATH="${GITHUB_WORKSPACE}"
else
echo "Please give the path to the repository root as environment variable 'jamulus_project_path' or parameter to this script!"
exit 1
fi

if [ -d "$THIS_JAMULUS_PROJECT_PATH" ]; then
echo "THIS_JAMULUS_PROJECT_PATH exists (relative): ${THIS_JAMULUS_PROJECT_PATH}"
## THIS_JAMULUS_PROJECT_PATH=$(readlink -e "${THIS_JAMULUS_PROJECT_PATH}") # works for linux, but not mac
THIS_JAMULUS_PROJECT_PATH=$(python -c "import os; print(os.path.abspath(\"${THIS_JAMULUS_PROJECT_PATH}\"));")
#python -c "import os; print(os.path.abspath(\"${THIS_JAMULUS_PROJECT_PATH}\"));"
echo "THIS_JAMULUS_PROJECT_PATH exists (absolute): ${THIS_JAMULUS_PROJECT_PATH}"
else
echo "ERROR: non-existing THIS_JAMULUS_PROJECT_PATH: ${THIS_JAMULUS_PROJECT_PATH}"
exit 1
fi

Empty file modified autobuild/linux/artifacts/autobuild_deb_1_prepare.sh
100644 → 100755
Empty file.
12 changes: 1 addition & 11 deletions autobuild/linux/artifacts/autobuild_deb_2_build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@
### PARAMETERS ###
####################

if [ ! -z "${1}" ]; then
THIS_JAMULUS_PROJECT_PATH="${1}"
elif [ ! -z "${jamulus_project_path}" ]; then
THIS_JAMULUS_PROJECT_PATH="${jamulus_project_path}"
elif [ ! -z "${GITHUB_WORKSPACE}" ]; then
THIS_JAMULUS_PROJECT_PATH="${GITHUB_WORKSPACE}"
else
echo "Please give the path to the repository root as environment variable 'jamulus_project_path' or parameter to this script!"
exit 1
fi

source $(dirname $(readlink -f "${BASH_SOURCE[0]}"))/../../ensure_THIS_JAMULUS_PROJECT_PATH.sh

###################
### PROCEDURE ###
Expand Down
12 changes: 1 addition & 11 deletions autobuild/linux/artifacts/autobuild_deb_3_copy_files.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@
### PARAMETERS ###
####################

if [ ! -z "${1}" ]; then
THIS_JAMULUS_PROJECT_PATH="${1}"
elif [ ! -z "${jamulus_project_path}" ]; then
THIS_JAMULUS_PROJECT_PATH="${jamulus_project_path}"
elif [ ! -z "${GITHUB_WORKSPACE}" ]; then
THIS_JAMULUS_PROJECT_PATH="${GITHUB_WORKSPACE}"
else
echo "Please give the path to the repository root as environment variable 'jamulus_project_path' or parameter to this script!"
exit 1
fi

source $(dirname $(readlink -f "${BASH_SOURCE[0]}"))/../../ensure_THIS_JAMULUS_PROJECT_PATH.sh

###################
### PROCEDURE ###
Expand Down
Empty file modified autobuild/linux/codeQL/auto_1_prepare.sh
100644 → 100755
Empty file.
11 changes: 1 addition & 10 deletions autobuild/linux/codeQL/auto_2_build_qt_project.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@
### PARAMETERS ###
####################

if [ ! -z "${1}" ]; then
THIS_JAMULUS_PROJECT_PATH="${1}"
elif [ ! -z "${jamulus_project_path}" ]; then
THIS_JAMULUS_PROJECT_PATH="${jamulus_project_path}"
elif [ ! -z "${GITHUB_WORKSPACE}" ]; then
THIS_JAMULUS_PROJECT_PATH="${GITHUB_WORKSPACE}"
else
echo "Please give the path to the repository root as environment variable 'jamulus_project_path' or parameter to this script!"
exit 1
fi
source $(dirname $(readlink -f "${0}"))/../../ensure_THIS_JAMULUS_PROJECT_PATH.sh


###################
Expand Down
Empty file modified autobuild/linux/codeQL/auto_3_copy_files.sh
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion autobuild/mac/artifacts/autobuild_mac_1_prepare.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# autobuild_1_prepare: set up environment, install Qt & dependencies


###################
### PROCEDURE ###
###################
Expand Down
12 changes: 1 addition & 11 deletions autobuild/mac/artifacts/autobuild_mac_2_build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@
### PARAMETERS ###
####################

if [ ! -z "${1}" ]; then
THIS_JAMULUS_PROJECT_PATH="${1}"
elif [ ! -z "${jamulus_project_path}" ]; then
THIS_JAMULUS_PROJECT_PATH="${jamulus_project_path}"
elif [ ! -z "${GITHUB_WORKSPACE}" ]; then
THIS_JAMULUS_PROJECT_PATH="${GITHUB_WORKSPACE}"
else
echo "Please give the path to the repository root as environment variable 'jamulus_project_path' or parameter to this script!"
exit 1
fi

source "$(dirname "${BASH_SOURCE[0]}")/../../ensure_THIS_JAMULUS_PROJECT_PATH.sh"

###################
### PROCEDURE ###
Expand Down
12 changes: 1 addition & 11 deletions autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@
### PARAMETERS ###
####################

if [ ! -z "${1}" ]; then
THIS_JAMULUS_PROJECT_PATH="${1}"
elif [ ! -z "${jamulus_project_path}" ]; then
THIS_JAMULUS_PROJECT_PATH="${jamulus_project_path}"
elif [ ! -z "${GITHUB_WORKSPACE}" ]; then
THIS_JAMULUS_PROJECT_PATH="${GITHUB_WORKSPACE}"
else
echo "Please give the path to the repository root as environment variable 'jamulus_project_path' or parameter to this script!"
exit 1
fi

source "$(dirname "${BASH_SOURCE[0]}")/../../ensure_THIS_JAMULUS_PROJECT_PATH.sh"

###################
### PROCEDURE ###
Expand Down
25 changes: 0 additions & 25 deletions autobuild/mac/codeQL/autobuild_mac_1_prepare.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,10 @@

# autobuild_1_prepare: set up environment, install Qt & dependencies


####################
### PARAMETERS ###
####################

if [ ! -z "${1}" ]; then
THIS_JAMULUS_PROJECT_PATH="${1}"
elif [ ! -z "${jamulus_project_path}" ]; then
THIS_JAMULUS_PROJECT_PATH="${jamulus_project_path}"
elif [ ! -z "${GITHUB_WORKSPACE}" ]; then
THIS_JAMULUS_PROJECT_PATH="${GITHUB_WORKSPACE}"
else
echo "Please give the path to the repository root as environment variable 'jamulus_project_path' or parameter to this script!"
exit 1
fi


###################
### PROCEDURE ###
###################

# please run this script with the first parameter being the root of the repo
if [ -z "${jamulus_project_path}" ]; then
echo "Please give the path to the repository root as environment parameter 'jamulus_project_path' to this script!"
exit 1
fi

cd "${GITHUB_WORKSPACE}"

echo "Install dependencies..."
brew install qt5
brew link qt5 --force
12 changes: 1 addition & 11 deletions autobuild/mac/codeQL/autobuild_mac_2_build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@
### PARAMETERS ###
####################

if [ ! -z "${1}" ]; then
THIS_JAMULUS_PROJECT_PATH="${1}"
elif [ ! -z "${jamulus_project_path}" ]; then
THIS_JAMULUS_PROJECT_PATH="${jamulus_project_path}"
elif [ ! -z "${GITHUB_WORKSPACE}" ]; then
THIS_JAMULUS_PROJECT_PATH="${GITHUB_WORKSPACE}"
else
echo "Please give the path to the repository root as environment variable 'jamulus_project_path' or parameter to this script!"
exit 1
fi

source $(dirname $(readlink "${0}"))/../../ensure_THIS_JAMULUS_PROJECT_PATH.sh

###################
### PROCEDURE ###
Expand Down
1 change: 0 additions & 1 deletion autobuild/mac/codeQL/autobuild_mac_3_copy_files.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
# autobuild_3_copy_files: copy the built files to deploy folder



echo "there are no artifacts in this run for CodeQL"

0 comments on commit a94950c

Please sign in to comment.