build-ios.yml 2.4 KB

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