|
| 1 | +name: Build Example App |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v[0-9]+.[0-9]+.[0-9]+" |
| 7 | + |
| 8 | +jobs: |
| 9 | + apk: |
| 10 | + name: Build Android APK |
| 11 | + runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + contents: write |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Setup JDK 18 |
| 19 | + uses: actions/setup-java@v4 |
| 20 | + with: |
| 21 | + java-version: 18 |
| 22 | + distribution: temurin |
| 23 | + |
| 24 | + - name: Setup Node.js |
| 25 | + uses: actions/setup-node@v4 |
| 26 | + with: |
| 27 | + node-version: '20' |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + run: | |
| 31 | + yarn install |
| 32 | + cd example |
| 33 | + yarn install |
| 34 | +
|
| 35 | + - name: Clean generated builds |
| 36 | + run: | |
| 37 | + cd example |
| 38 | + rm -rf android/app/build/generated/ |
| 39 | +
|
| 40 | + - name: Gradle build APK |
| 41 | + run: | |
| 42 | + cd example |
| 43 | + cd android |
| 44 | + chmod +x gradlew |
| 45 | + ./gradlew app:assembleRelease |
| 46 | +
|
| 47 | + - name: Release APK |
| 48 | + uses: softprops/action-gh-release@v2 |
| 49 | + if: startsWith(github.ref, 'refs/tags/') |
| 50 | + with: |
| 51 | + files: example/android/app/build/outputs/apk/release/*.apk |
| 52 | + |
| 53 | + ipa: |
| 54 | + runs-on: macos-14 |
| 55 | + name: Build iOS IPA |
| 56 | + permissions: |
| 57 | + contents: write |
| 58 | + steps: |
| 59 | + - name: Checkout |
| 60 | + uses: actions/checkout@v4 |
| 61 | + |
| 62 | + - name: Setup Node.js |
| 63 | + uses: actions/setup-node@v4 |
| 64 | + with: |
| 65 | + node-version: "20" |
| 66 | + |
| 67 | + - name: Install dependencies |
| 68 | + run: | |
| 69 | + yarn install |
| 70 | + cd example |
| 71 | + yarn install |
| 72 | +
|
| 73 | + - name: pod Install |
| 74 | + run: | |
| 75 | + cd example |
| 76 | + cd ios |
| 77 | + rm Podfile.lock |
| 78 | + pod install --repo-update |
| 79 | +
|
| 80 | + - name: Create Example Workspace |
| 81 | + run: | |
| 82 | + cd example |
| 83 | + cd ios |
| 84 | + cp -r GetRandomValuesExample.xcworkspace example.xcworkspace |
| 85 | +
|
| 86 | + - name: Xcode build |
| 87 | + run: | |
| 88 | + cd example |
| 89 | + cd ios |
| 90 | + xcodebuild -scheme GetRandomValuesExample -workspace example.xcworkspace -configuration Release clean archive -archivePath "build/GetRandomValuesExample.xcarchive" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO |
| 91 | +
|
| 92 | + - name: Archive to IPA |
| 93 | + run: | |
| 94 | + cd example |
| 95 | + cd ios |
| 96 | + mkdir build/Payload |
| 97 | + mv build/GetRandomValuesExample.xcarchive/Products/Applications/GetRandomValuesExample.app build/Payload/GetRandomValuesExample.app |
| 98 | + cd build |
| 99 | + zip -r GetRandomValuesExample.ipa Payload/ |
| 100 | +
|
| 101 | + - name: Release IPA |
| 102 | + uses: softprops/action-gh-release@v2 |
| 103 | + if: startsWith(github.ref, 'refs/tags/') |
| 104 | + with: |
| 105 | + files: example/ios/build/GetRandomValuesExample.ipa |
0 commit comments