Skip to content

Commit

Permalink
Add quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
ann0see committed Feb 15, 2021
1 parent 10152e5 commit c8a5603
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 112 deletions.
86 changes: 43 additions & 43 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ on:
tags:
- "r*"
- "latest"
branches:
branches:
- "autobuild*" # for developers: branches starting with autobuild will be built and evaluated on each push
- "autobuild/*" # for developers: branches starting with autobuild will be built and evaluated on each push
- master
- "master"
# - "*"
pull_request: # The branches below must be a subset of the branches in "push"
branches:
branches:
- master

name: Auto-Build
jobs:
create_release:
Expand All @@ -47,7 +47,7 @@ jobs:
version_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_VERSION_NAME }}
x_github_workspace: ${{ steps.jamulus-build-vars.outputs.X_GITHUB_WORKSPACE }} #needed, because matrix can not directly access ${{ github.workspace }} aparrently
build_flatpack: ${{ steps.jamulus-build-vars.outputs.BUILD_FLATPACK }}


steps:
# Checkout code
Expand Down Expand Up @@ -96,63 +96,63 @@ jobs:
strategy:
fail-fast: false
matrix: # Think of this like a foreach loop. Basically runs the steps with every combination of the contents of this. More info: https://docs.github.com/en/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
config:
config:
- config_name: AndroidAPK (artifact+codeql)
target_os: android
building_on_os: ubuntu-20.04
cmd1_prebuild: "sh android/autobuild/autobuild_apk_1_prepare.sh "
cmd2_build: "sh android/autobuild/autobuild_apk_2_build.sh "
cmd3_postbuild: "sh android/autobuild/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 linux/autobuild/codeQL/auto_1_prepare.sh ${{ needs.create_release.outputs.x_github_workspace }}"
cmd2_build: "sh linux/autobuild/codeQL/auto_2_build_qt_project.sh "
cmd3_postbuild: "sh linux/autobuild/codeQL/auto_3_copy_files.sh "
cmd2_build: "sh linux/autobuild/codeQL/auto_2_build_qt_project.sh"
cmd3_postbuild: "sh linux/autobuild/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 linux/autobuild/artifacts/autobuild_deb_1_prepare.sh "
cmd2_build: "sh linux/autobuild/artifacts/autobuild_deb_2_build.sh "
cmd3_postbuild: "sh linux/autobuild/artifacts/autobuild_deb_3_copy_files.sh "
cmd1_prebuild: "sh linux/autobuild/artifacts/autobuild_deb_1_prepare.sh"
cmd2_build: "sh linux/autobuild/artifacts/autobuild_deb_2_build.sh"
cmd3_postbuild: "sh linux/autobuild/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 mac/autobuild/codeQL/autobuild_mac_1_prepare.sh "
cmd2_build: "sh mac/autobuild/codeQL/autobuild_mac_2_build.sh "
cmd3_postbuild: "sh mac/autobuild/codeQL/autobuild_mac_3_copy_files.sh "
cmd1_prebuild: "sh mac/autobuild/codeQL/autobuild_mac_1_prepare.sh"
cmd2_build: "sh mac/autobuild/codeQL/autobuild_mac_2_build.sh"
cmd3_postbuild: "sh mac/autobuild/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 mac/autobuild/artifacts/autobuild_mac_1_prepare.sh "
cmd2_build: "sh mac/autobuild/artifacts/autobuild_mac_2_build.sh "
cmd3_postbuild: "sh mac/autobuild/artifacts/autobuild_mac_3_copy_files.sh "
cmd1_prebuild: "sh mac/autobuild/artifacts/autobuild_mac_1_prepare.sh"
cmd2_build: "sh mac/autobuild/artifacts/autobuild_mac_2_build.sh"
cmd3_postbuild: "sh mac/autobuild/artifacts/autobuild_mac_3_copy_files.sh"
uses_codeql: false

- config_name: Windows (artifact+codeql)
target_os: windows
building_on_os: windows-latest
cmd1_prebuild: powershell ./windows/autobuild/autobuild_windowsinstaller_1_prepare.ps1
cmd2_build: powershell ./windows/autobuild/autobuild_windowsinstaller_2_build.ps1
cmd3_postbuild: powershell ./windows/autobuild/autobuild_windowsinstaller_3_copy_files.ps1
uses_codeql: true
cmd1_prebuild: powershell .\windows\autobuild\autobuild_windowsinstaller_1_prepare.ps1
cmd2_build: powershell .\windows\autobuild\autobuild_windowsinstaller_2_build.ps1
cmd3_postbuild: powershell .\windows\autobuild\autobuild_windowsinstaller_3_copy_files.ps1
uses_codeql: true

runs-on: ${{ matrix.config.building_on_os }}
steps:
# Checkout code
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true

# Prepare (install QT & dependencies)
- name: "Prepare for ${{ matrix.config.config_name }}"
if: ${{ matrix.config.cmd1_prebuild }}
Expand All @@ -161,33 +161,33 @@ jobs:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' # allow setting environment variables
jamulus_project_path: ${{ github.workspace }}
jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }}

# Initialize CodeQL tools for code-scanning for security
- name: Initialize CodeQL
if: matrix.config.uses_codeql
if: matrix.config.uses_codeql
uses: github/codeql-action/init@v1
with:
languages: 'cpp'
languages: 'cpp'
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

# Build
- name: "Build for ${{ matrix.config.config_name }}"
if: ${{ matrix.config.cmd2_build }}
if: ${{ matrix.config.cmd2_build }}
run: ${{ matrix.config.cmd2_build }} ${{ github.workspace }}
env:
jamulus_project_path: ${{ github.workspace }}
jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }}

- name: "Post-Build for ${{ matrix.config.config_name }}"
id: step_cmd3_postbuild
if: ${{ matrix.config.cmd3_postbuild }}
run: ${{ matrix.config.cmd3_postbuild }} ${{ github.workspace }}
env:
jamulus_project_path: ${{ github.workspace }}
jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }}

# Upload Artifact to Job
- name: Upload Artifact 1 to Job
if: ${{ steps.step_cmd3_postbuild.outputs.artifact_1 }}
Expand All @@ -197,7 +197,7 @@ jobs:
path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }}
retention-days: 31
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

# Upload Artifact to Job
- name: Upload Artifact 2 to Job
if: ${{ steps.step_cmd3_postbuild.outputs.artifact_2 }}
Expand Down Expand Up @@ -232,13 +232,13 @@ jobs:
asset_path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_2 }}
asset_name: ${{ steps.step_cmd3_postbuild.outputs.artifact_2 }}
asset_content_type: application/octet-stream

# Run CodeQL tools for code-scanning for security
- name: Perform CodeQL Analysis
if: matrix.config.uses_codeql
if: matrix.config.uses_codeql
uses: github/codeql-action/analyze@v1


## Builds a Linux flatpack ##
flatpak-builder:
name: "Build Flatpak (artifact)"
Expand All @@ -258,24 +258,24 @@ jobs:
jamulus_project_path: ${{ github.workspace }}
jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }}
- uses: bilelmoussaoui/flatpak-github-actions@v2
with:
with:
bundle: "${{ steps.flatpak-prepare.outputs.flatpak_bundle }}"
manifest-path: "distributions/io.jamulus.Jamulus.json"

# download artifact
- id: flatpak-download
uses: actions/download-artifact@v2
with:
name: ${{ steps.flatpak-prepare.outputs.flatpak_name }}
path: ~/${{ steps.flatpak-prepare.outputs.flatpak_name }}

- name: echo download-path
run: "echo ${{steps.flatpak-download.outputs.download-path}}"
- name: ls download-path
run: "ls ${{steps.flatpak-download.outputs.download-path}}"
- name: ls githome ~
run: "ls ~/"

# Upload Artifact to Release
- name: Upload Flatpack
if: ${{ contains(needs.create_release.outputs.publish_to_release, 'true') }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

$QTDIR/bin/qmake -spec android-clang CONFIG+=$CONFIG
"${QTDIR}"/bin/qmake -spec android-clang CONFIG+="${CONFIG}"
/opt/android/android-ndk/prebuilt/linux-x86_64/bin/make
$ANDROID_NDK_ROOT/prebuilt/$ANDROID_NDK_HOST/bin/make INSTALL_ROOT=android-build -f Makefile install
$QTDIR/bin/androiddeployqt --input $(ls *.json) --output android-build --android-platform android-30 --jdk $JAVA_HOME --gradle
"${ANDROID_NDK_ROOT}"/prebuilt/"${ANDROID_NDK_HOST}"/bin/make INSTALL_ROOT=android-build -f Makefile install
"${QTDIR}"/bin/androiddeployqt --input $(ls *.json) --output android-build --android-platform android-30 --jdk "${JAVA_HOME}" --gradle
56 changes: 28 additions & 28 deletions android/autobuild/autobuild_apk_1_prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,74 +15,74 @@
export DEBIAN_FRONTEND="noninteractive"
echo "::set-env name=DEBIAN_FRONTEND::${DEBIAN_FRONTEND}"

sudo apt-get update
sudo apt-get -qq -y install build-essential git zip unzip bzip2 p7zip-full wget curl chrpath libxkbcommon-x11-0
sudo apt-get update
sudo apt-get -qq -y install build-essential git zip unzip bzip2 p7zip-full wget curl chrpath libxkbcommon-x11-0
# Dependencies to create Android pkg
sudo apt-get -qq -y install openjdk-8-jre openjdk-8-jdk openjdk-8-jdk-headless gradle
sudo apt-get -qq -y install openjdk-8-jre openjdk-8-jdk openjdk-8-jdk-headless gradle
# Clean apt cache
sudo apt-get clean
sudo apt-get clean
rm -rf /var/lib/apt/lists/*

# Add Android tools and platform tools to PATH
export ANDROID_HOME="/opt/android/android-sdk"
export ANDROID_SDK_ROOT="/opt/android/android-sdk"
export ANDROID_NDK_ROOT="/opt/android/android-ndk"

export PATH="$PATH:$ANDROID_HOME/tools"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
export PATH="${PATH}:${ANDROID_HOME}/tools"
export PATH="${PATH}:${ANDROID_HOME}/platform-tools"
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"

# other variables
export MY_QT_VERSION="5.15.2"
export ANDROID_NDK_HOST="linux-x86_64"
export ANDROID_SDKMANAGER="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager"
export ANDROID_SDKMANAGER="${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager"

# paths for Android SDK
mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools/latest/
mkdir -p ${ANDROID_SDK_ROOT}/build-tools/latest/
mkdir -p "${ANDROID_SDK_ROOT}"/cmdline-tools/latest/
mkdir -p "${ANDROID_SDK_ROOT}"/build-tools/latest/

# Install Android sdk
#https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip
#https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
downloadfile="downloadfile"
wget -q -O downloadfile https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip
unzip -q downloadfile
rm downloadfile
mv cmdline-tools/* /opt/android/android-sdk/cmdline-tools/latest/
#https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
downloadfile="downloadfile"
wget -q -O downloadfile https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip
unzip -q downloadfile
rm downloadfile
mv cmdline-tools/* /opt/android/android-sdk/cmdline-tools/latest/
rm -r cmdline-tools

# Install Android ndk
#https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip
#https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip
downloadfile="downloadfile"
wget -q -O downloadfile https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip
unzip -q downloadfile
rm downloadfile
downloadfile="downloadfile"
wget -q -O downloadfile https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip
unzip -q downloadfile
rm downloadfile
mv android-ndk-r21d /opt/android/android-ndk


# Install Android SDK
yes | $ANDROID_SDKMANAGER --licenses
#echo yes | $ANDROID_SDKMANAGER --licenses
$ANDROID_SDKMANAGER --update
yes | "${ANDROID_SDKMANAGER}" --licenses
#echo yes | $ANDROID_SDKMANAGER --licenses
"${ANDROID_SDKMANAGER}" --update
#$ANDROID_SDKMANAGER "platforms;android-17"
#$ANDROID_SDKMANAGER "platforms;android-28"
$ANDROID_SDKMANAGER "platforms;android-30"
"${ANDROID_SDKMANAGER}" "platforms;android-30"
#$ANDROID_SDKMANAGER "build-tools;28.0.3"
$ANDROID_SDKMANAGER "build-tools;30.0.2"
"${ANDROID_SDKMANAGER}" "build-tools;30.0.2"



# Download / install Qt
####ADD https://code.qt.io/cgit/qbs/qbs.git/plain/scripts/install-qt.sh ./
#COPY install-qt.sh /install-qt.sh
THIS_SCRIPT=$(readlink -f "$0")
THIS_SCRIPT=$(readlink -f "${0}")
# Absolute path this script is in, thus /home/user/bin
THIS_SCRIPT_PATH=$(dirname "$THIS_SCRIPT")
bash $THIS_SCRIPT_PATH/install-qt.sh --version $MY_QT_VERSION --target android --toolchain android qtbase qt3d qtdeclarative qtandroidextras qtconnectivity qtgamepad qtlocation qtmultimedia qtquickcontrols2 qtremoteobjects qtscxml qtsensors qtserialport qtsvg qtimageformats qttools qtspeech qtwebchannel qtwebsockets qtwebview qtxmlpatterns qttranslations
THIS_SCRIPT_PATH=$(dirname "${THIS_SCRIPT}")
bash "${THIS_SCRIPT_PATH}"/install-qt.sh --version "${MY_QT_VERSION}" --target android --toolchain android qtbase qt3d qtdeclarative qtandroidextras qtconnectivity qtgamepad qtlocation qtmultimedia qtquickcontrols2 qtremoteobjects qtscxml qtsensors qtserialport qtsvg qtimageformats qttools qtspeech qtwebchannel qtwebsockets qtwebview qtxmlpatterns qttranslations

# Set the QTDIR environment variable
export QTDIR="/opt/Qt/$MY_QT_VERSION/android"
export QTDIR="/opt/Qt/${MY_QT_VERSION}/android"


#necessary
Expand Down
8 changes: 4 additions & 4 deletions android/autobuild/autobuild_apk_2_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ fi
### PROCEDURE ###
###################

cd ${THIS_JAMULUS_PROJECT_PATH}
cd "${THIS_JAMULUS_PROJECT_PATH}"

#$QTDIR/bin/qmake -spec android-clang CONFIG+=$CONFIG
$QTDIR/bin/qmake -spec android-clang CONFIG+=release
"${QTDIR}"/bin/qmake -spec android-clang CONFIG+=release
echo .
echo .
echo .
Expand All @@ -36,9 +36,9 @@ echo .
echo .
echo .
echo .
$ANDROID_NDK_ROOT/prebuilt/$ANDROID_NDK_HOST/bin/make INSTALL_ROOT=android-build -f Makefile install
"${ANDROID_NDK_ROOT}"/prebuilt/"${ANDROID_NDK_HOST}"/bin/make INSTALL_ROOT=android-build -f Makefile install
echo .
echo .
echo .
echo .
$QTDIR/bin/androiddeployqt --input $(ls *.json) --output android-build --android-platform android-30 --jdk $JAVA_HOME --gradle
"${QTDIR}"/bin/androiddeployqt --input $(ls *.json) --output android-build --android-platform android-30 --jdk "${JAVA_HOME}" --gradle
12 changes: 6 additions & 6 deletions android/autobuild/autobuild_apk_3_copy_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ fi
### PROCEDURE ###
###################

mkdir ${THIS_JAMULUS_PROJECT_PATH}/deploy
mkdir "${THIS_JAMULUS_PROJECT_PATH}"/deploy

echo ""
echo ""
echo "ls GITROOT/android-build/build/outputs/apk/debug/"
ls ${THIS_JAMULUS_PROJECT_PATH}/android-build/build/outputs/apk/debug/
ls "${THIS_JAMULUS_PROJECT_PATH}"/android-build/build/outputs/apk/debug/
echo ""


artifact_deploy_filename=jamulus_${jamulus_buildversionstring}_android.apk
echo ""
echo ""
echo ""
echo "move to ${artifact_deploy_filename}"
mv ${THIS_JAMULUS_PROJECT_PATH}/android-build/build/outputs/apk/debug/android-build-debug.apk ${THIS_JAMULUS_PROJECT_PATH}/deploy/${artifact_deploy_filename}
mv "${THIS_JAMULUS_PROJECT_PATH}"/android-build/build/outputs/apk/debug/android-build-debug.apk "${THIS_JAMULUS_PROJECT_PATH}"/deploy/"${artifact_deploy_filename}"

echo ""
echo ""
echo "ls GITROOT/deploy/"
ls ${THIS_JAMULUS_PROJECT_PATH}/deploy/
ls "${THIS_JAMULUS_PROJECT_PATH}"/deploy/
echo ""

github_output_value()
Expand Down
2 changes: 1 addition & 1 deletion linux/autobuild/artifacts/autobuild_deb_1_prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ sudo apt-get -qq update
# We don't upgrade the packages. If this is needed, just uncomment this line
# sudo apt-get -qq -y upgrade
echo "Install dependencies..."
sudo apt-get -qq -y install devscripts build-essential debhelper libjack-jackd2-dev qtbase5-dev qttools5-dev-tools
sudo apt-get -qq -y install devscripts build-essential debhelper libjack-jackd2-dev qtbase5-dev qttools5-dev-tools
Loading

0 comments on commit c8a5603

Please sign in to comment.