Browse Source

prepare CI for iOS

Andrey Filipenkov 3 years ago
parent
commit
d3e33b096f
4 changed files with 21 additions and 3 deletions
  1. 8 0
      .github/workflows/github.yml
  2. 7 0
      CI/ios/before_install.sh
  3. 3 0
      CI/ios/post_pack.sh
  4. 3 3
      CMakePresets.json

+ 8 - 0
.github/workflows/github.yml

@@ -90,6 +90,12 @@ jobs:
             preset: macos-arm-conan-ninja-release
             conan_profile: macos-arm
             artifact_platform: arm
+          - platform: ios
+            os: macos-12
+            test: 0
+            pack: 1
+            extension: ipa
+            preset: ios-release
           - platform: mxe
             os: ubuntu-20.04
             mxe: i686-w64-mingw32.shared
@@ -189,6 +195,8 @@ jobs:
         cd '${{github.workspace}}/out/build/${{matrix.preset}}'
         CPACK_PATH=`which -a cpack | grep -m1 -v -i chocolatey`
         "$CPACK_PATH" -C ${{env.BUILD_TYPE}} ${{ matrix.cpack_args }}
+        test -f '${{github.workspace}}/CI/${{matrix.platform}}/post_pack.sh' \
+          && '${{github.workspace}}/CI/${{matrix.platform}}/post_pack.sh' '${{github.workspace}}' "$(ls '${{ env.VCMI_PACKAGE_FILE_NAME }}'.*)"
         rm -rf _CPack_Packages
 
     - name: Additional logs

+ 7 - 0
CI/ios/before_install.sh

@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+echo DEVELOPER_DIR=/Applications/Xcode_13.4.1.app >> $GITHUB_ENV
+
+curl -L 'https://github.com/kambala-decapitator/vcmi-ios-depends/releases/latest/download/vcmi-ios-depends-xc13.2.1.txz' \
+	| tar -xf -
+build/fix_install_paths.command

+ 3 - 0
CI/ios/post_pack.sh

@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+"$1/ios/zip2ipa.sh" "$2"

+ 3 - 3
CMakePresets.json

@@ -132,7 +132,7 @@
             ],
             "cacheVariables": {
                 "BUNDLE_IDENTIFIER_PREFIX": "eu.vcmi",
-                "CMAKE_PREFIX_PATH": "TODO"
+                "CMAKE_PREFIX_PATH": "${sourceDir}/build/iphoneos"
             }
         }
     ],
@@ -187,11 +187,11 @@
             "name": "ios-release",
             "configurePreset": "ios-release",
             "inherits": "default-release",
+            "configuration": "Release",
             "targets": ["vcmiclient"],
             "nativeToolOptions": [
                 "-quiet",
-                "CODE_SIGNING_ALLOWED_FOR_APPS=NO",
-                "GCC_OPTIMIZATION_LEVEL=3"
+                "CODE_SIGNING_ALLOWED_FOR_APPS=NO"
             ]
         }
     ],