diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ae43b35 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: react-native-android-build-apk +on: + pull_request: + branches: + - dev +jobs: + install-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: "20.x" + - name: Install npm dependencies + run: | + npm install + build-android: + needs: install-and-test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install npm dependencies + run: | + npm install + - name: Build Android Release + run: | + cd android && ./gradlew assembleRelease + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: app-release.apk + path: android/app/build/outputs/apk/release/ + - name: Post Artifact Link in PR Comment + uses: unsplash/comment-on-pr@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + msg: "Android APK build is complete. You can download the release APK here: [Download APK](https://github.com/${{ github.repository }}/actions/runs/${{github.run_id}})" + check_for_duplicate_msg: false