build-ios.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # This workflow tries to build iOS app if any changes detected on the iOS source tree,
  2. # ensuring at least it builds.
  3. name: CI-iOS
  4. on:
  5. push:
  6. branches: [master]
  7. paths:
  8. - 'ios/App'
  9. pull_request:
  10. branches: [master]
  11. paths:
  12. - 'ios/App'
  13. env:
  14. CLOJURE_VERSION: '1.10.1.763'
  15. NODE_VERSION: '16'
  16. JAVA_VERSION: '11'
  17. jobs:
  18. build-app:
  19. runs-on: macos-latest
  20. steps:
  21. - name: Check out Git repository
  22. uses: actions/checkout@v2
  23. - name: Install Node.js, NPM and Yarn
  24. uses: actions/setup-node@v2
  25. with:
  26. node-version: ${{ env.NODE_VERSION }}
  27. - name: Get yarn cache directory path
  28. id: yarn-cache-dir-path
  29. run: echo "::set-output name=dir::$(yarn cache dir)"
  30. - name: Cache yarn cache directory
  31. uses: actions/cache@v2
  32. id: yarn-cache
  33. with:
  34. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  35. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  36. restore-keys: |
  37. ${{ runner.os }}-yarn-
  38. - name: Setup Java JDK
  39. uses: actions/setup-java@v2
  40. with:
  41. distribution: 'zulu'
  42. java-version: ${{ env.JAVA_VERSION }}
  43. - name: Cache clojure deps
  44. uses: actions/cache@v2
  45. with:
  46. path: |
  47. ~/.m2/repository
  48. ~/.gitlibs
  49. key: ${{ runner.os }}-clojure-lib-${{ hashFiles('**/deps.edn') }}
  50. - name: Setup clojure
  51. uses: DeLaGuardo/[email protected]
  52. with:
  53. cli: ${{ env.CLOJURE_VERSION }}
  54. - name: Set Build Environment Variables
  55. run: |
  56. echo "ENABLE_FILE_SYNC_PRODUCTION=true" >> $GITHUB_ENV
  57. - name: Compile CLJS
  58. run: yarn install && yarn release-app
  59. - name: Sync static build files
  60. run: rsync -avz --exclude node_modules --exclude '*.js.map' --exclude android ./static/ ./public/static/
  61. - name: Prepare iOS build
  62. run: npx cap sync ios
  63. - name: List iOS build targets
  64. run: xcodebuild -list -workspace App.xcworkspace
  65. working-directory: ./ios/App
  66. - name: Build iOS App
  67. run: |
  68. xcodebuild -workspace App.xcworkspace -scheme Logseq -destination generic/platform=iOS build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
  69. working-directory: ./ios/App