build-ios-release.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # This workflow build iOS App as a .ipa file and upload it to TestFlight.
  2. name: Build-iOS
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. git-ref:
  7. description: "Release Git Ref (Which branch or tag to build?)"
  8. required: true
  9. default: "master"
  10. env:
  11. CLOJURE_VERSION: '1.11.1.1413'
  12. NODE_VERSION: '22'
  13. JAVA_VERSION: '11'
  14. jobs:
  15. build-app:
  16. runs-on: macos-26
  17. steps:
  18. - name: Check out Git repository
  19. uses: actions/checkout@v4
  20. with:
  21. ref: ${{ github.event.inputs.git-ref }}
  22. - uses: maxim-lobanov/setup-xcode@v1
  23. with:
  24. xcode-version: '26.0.1'
  25. - name: Show runtimes
  26. run: |
  27. xcrun simctl list > /dev/null
  28. - name: Install iOS platform
  29. run: |
  30. xcodebuild -downloadPlatform iOS
  31. - name: Install Node.js, NPM and Yarn
  32. uses: actions/setup-node@v4
  33. with:
  34. node-version: ${{ env.NODE_VERSION }}
  35. - name: Setup Java JDK
  36. uses: actions/setup-java@v4
  37. with:
  38. distribution: 'zulu'
  39. java-version: ${{ env.JAVA_VERSION }}
  40. - name: Cache clojure deps
  41. uses: actions/cache@v4
  42. with:
  43. path: |
  44. ~/.m2/repository
  45. ~/.gitlibs
  46. key: ${{ runner.os }}-clojure-lib-${{ hashFiles('**/deps.edn') }}
  47. - name: Setup clojure
  48. uses: DeLaGuardo/[email protected]
  49. with:
  50. cli: ${{ env.CLOJURE_VERSION }}
  51. - name: Setup build tools
  52. run: brew install fastlane
  53. - name: Set Build Environment Variables
  54. run: |
  55. echo "ENABLE_FILE_SYNC_PRODUCTION=true" >> $GITHUB_ENV
  56. - name: Compile CLJS
  57. run: yarn install && yarn release-mobile
  58. env:
  59. LOGSEQ_SENTRY_DSN: ${{ secrets.LOGSEQ_SENTRY_DSN }}
  60. LOGSEQ_POSTHOG_TOKEN: ${{ secrets.LOGSEQ_POSTHOG_TOKEN }}
  61. - name: Upload Sentry Sourcemaps (beta only)
  62. # if: ${{ github.repository == 'logseq/logseq' && (inputs.build-target == 'beta' || github.event.inputs.build-target == 'beta') }}
  63. run: |
  64. curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.58.4 bash
  65. release_name="logseq-ios@${{ steps.ref.outputs.version }}"
  66. sentry-cli releases new "${release_name}"
  67. sentry-cli releases files "${release_name}" upload-sourcemaps --ext map --ext js ./static/js --url-prefix '~/static/js'
  68. sentry-cli releases finalize "${release_name}"
  69. env:
  70. SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
  71. SENTRY_ORG: logseq
  72. SENTRY_PROJECT: logseq
  73. - name: Prepare iOS build
  74. run: npx cap sync ios
  75. - name: Build and upload iOS app
  76. run: fastlane beta
  77. working-directory: ./ios/App
  78. env:
  79. APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
  80. APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
  81. APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
  82. APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64: true
  83. SLACK_URL: ${{ secrets.SLACK_URL }}
  84. MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
  85. MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
  86. XCODE_XCARGS: "-allowProvisioningUpdates"
  87. - name: Save Static File
  88. uses: actions/upload-artifact@v4
  89. with:
  90. name: static
  91. path: static
  92. retention-days: 3