|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + |
| 9 | +env: |
| 10 | + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} |
| 11 | + SENTRY_ALLOW_FAILURE: false |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + build-android: |
| 19 | + name: Android |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - uses: actions/setup-node@v4 |
| 25 | + with: |
| 26 | + node-version: 18 |
| 27 | + cache: 'npm' |
| 28 | + cache-dependency-path: package-lock.json |
| 29 | + |
| 30 | + - run: npm ci |
| 31 | + |
| 32 | + - uses: actions/setup-java@v4 |
| 33 | + with: |
| 34 | + java-version: '17' |
| 35 | + distribution: 'adopt' |
| 36 | + |
| 37 | + - uses: gradle/gradle-build-action@v3 |
| 38 | + |
| 39 | + - working-directory: android |
| 40 | + run: ./gradlew :app:assembleRelease |
| 41 | + |
| 42 | + - name: Upload APK |
| 43 | + uses: actions/upload-artifact@v4 |
| 44 | + with: |
| 45 | + name: empower-plant-react-native-android |
| 46 | + path: android/app/build/outputs/apk/release/app-release.apk |
| 47 | + retention-days: 60 |
| 48 | + |
| 49 | + build-ios: |
| 50 | + name: iOS |
| 51 | + runs-on: macos-14 |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + |
| 55 | + - uses: actions/setup-node@v4 |
| 56 | + with: |
| 57 | + node-version: 18 |
| 58 | + cache: 'npm' |
| 59 | + cache-dependency-path: package-lock.json |
| 60 | + |
| 61 | + - run: npm ci |
| 62 | + |
| 63 | + - uses: ruby/setup-ruby@v1 |
| 64 | + with: |
| 65 | + ruby-version: '3.3.0' |
| 66 | + bundler-cache: true # runs 'bundle install' and caches installed gems automatically |
| 67 | + |
| 68 | + - working-directory: ios |
| 69 | + run: bundle exec pod install |
| 70 | + |
| 71 | + - name: Run xcodebuild |
| 72 | + working-directory: ios |
| 73 | + run: | |
| 74 | + mkdir -p "DerivedData" |
| 75 | + derivedData="$(cd "DerivedData" ; pwd -P)" |
| 76 | + set -o pipefail && xcodebuild \ |
| 77 | + -workspace sentry_react_native.xcworkspace \ |
| 78 | + -configuration "Release" \ |
| 79 | + -scheme sentry_react_native \ |
| 80 | + -destination 'generic/platform=iOS Simulator' \ |
| 81 | + -derivedDataPath "$derivedData" \ |
| 82 | + build \ |
| 83 | + | tee xcodebuild.log \ |
| 84 | + | xcbeautify --quieter --is-ci --disable-colored-output |
| 85 | +
|
| 86 | + - name: Upload APP |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: empower-plant-react-native-ios |
| 90 | + path: ios/DerivedData/Build/Products/Release-iphonesimulator/sentry_react_native.app |
| 91 | + retention-days: 60 |
| 92 | + |
| 93 | + - name: Upload logs |
| 94 | + if: ${{ always() }} |
| 95 | + uses: actions/upload-artifact@v4 |
| 96 | + with: |
| 97 | + name: build-ios-logs |
| 98 | + path: ios/xcodebuild.log |
0 commit comments