Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ jobs:
uses_codeql: false
xcode_version: 12.1.1

- config_name: iOS (artifacts)
target_os: ios
building_on_os: macos-10.15
cmd1_prebuild: "./autobuild/ios/artifacts/autobuild_ios_1_prepare.sh 5.15.2"
cmd2_build: "./autobuild/ios/artifacts/autobuild_ios_2_build.sh"
cmd3_postbuild: "./autobuild/ios/artifacts/autobuild_ios_3_copy_files.sh"
uses_codeql: false
xcode_version: 12.1.1

- config_name: MacOS Legacy (artifacts)
target_os: macos
building_on_os: macos-10.15
Expand Down Expand Up @@ -162,7 +171,7 @@ jobs:
steps:

- name: Select Xcode version for Mac
if: ${{ matrix.config.target_os == 'macos' }}
if: ${{ matrix.config.target_os == 'macos' || matrix.config.target_os == 'ios' }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.config.xcode_version }}
Expand Down
31 changes: 31 additions & 0 deletions autobuild/ios/artifacts/autobuild_ios_1_prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash -e

# autobuild_1_prepare: set up environment, install Qt & dependencies

if [ "$#" -ne "1" ]; then
echo "need to specify Qt version"
exit 1
fi

QT_DIR=/usr/local/opt/qt
QT_VER=$1
AQTINSTALL_VERSION=2.0.5

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

echo "Install dependencies..."
python3 -m pip install "aqtinstall==${AQTINSTALL_VERSION}"
python3 -m aqt install-qt --outputdir "${QT_DIR}" mac ios ${QT_VER}

Comment on lines +18 to +21
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs caching.

# Add the qt binaries to the PATH.
# The clang_64 entry can be dropped when Qt <6.2 compatibility is no longer needed.
for qt_path in "${QT_DIR}"/${QT_VER}/ios/bin "${QT_DIR}"/${QT_VER}/clang_64/bin; do
if [[ -d $qt_path ]]; then
export -p PATH="${qt_path}:${PATH}"
break
fi
done
echo "::set-env name=PATH::${PATH}"
echo "the path is ${PATH}"
27 changes: 27 additions & 0 deletions autobuild/ios/artifacts/autobuild_ios_2_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh -e

# autobuild_2_build: actual build process


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


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

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

cd "${THIS_JAMULUS_PROJECT_PATH}"

qmake -spec macx-xcode Jamulus.pro
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected the spec to be the iOS build rather than the macx target here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. But that's what builds for iOS

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so how does:

 else:ios {
    QMAKE_INFO_PLIST = ios/Info.plist
    QT += macextras
    OBJECTIVE_SOURCES += ios/ios_app_delegate.mm
    HEADERS += ios/ios_app_delegate.h
    HEADERS += ios/sound.h
    OBJECTIVE_SOURCES += ios/sound.mm
    QMAKE_TARGET_BUNDLE_PREFIX = io.jamulus
    QMAKE_APPLICATION_BUNDLE_NAME. = $$TARGET
    LIBS += -framework AVFoundation \
        -framework AudioToolbox
} 

play into the build?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it generates the .xcodeproject for iOS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the build includes the iOS version of Qt, probably qmake knows it is building for iOS. Certainly the log shows a line for building ios/sound.mm

/usr/bin/xcodebuild -project Jamulus.xcodeproj -scheme Jamulus -configuration Release clean archive -archivePath "build/Jamulus.xcarchive" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
# Make a deploy folder
mkdir deploy
# Generate ipa by copying the .app file from the xcarchive file
mkdir deploy/Payload
cp -r build/Jamulus.xcarchive/Products/Applications/Jamulus.app deploy/Payload/
cd deploy
zip -0 -y -r Jamulus.ipa Payload/
48 changes: 48 additions & 0 deletions autobuild/ios/artifacts/autobuild_ios_3_copy_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh -e
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly copied from macOS.


# autobuild_3_copy_files: copy the built files to deploy folder

if [ "$#" -gt 1 ]; then
BUILD_SUFFIX=_$1
shift
fi

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

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

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

cd "${THIS_JAMULUS_PROJECT_PATH}"

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

echo ""
echo ""
artifact_deploy_filename=jamulus_${jamulus_buildversionstring}_iOSUnsigned${BUILD_SUFFIX}.ipa
echo "Move/Rename the built file to deploy/${artifact_deploy_filename}"
mv "${THIS_JAMULUS_PROJECT_PATH}"/deploy/Jamulus.ipa "${THIS_JAMULUS_PROJECT_PATH}"/deploy/"${artifact_deploy_filename}"


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


github_output_value()
{
echo "github_output_value() ${1} = ${2}"
echo "::set-output name=${1}::${2}"
}

github_output_value artifact_1 ${artifact_deploy_filename}