diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml new file mode 100644 index 0000000..42cceb6 --- /dev/null +++ b/.github/workflows/develop.yml @@ -0,0 +1,62 @@ +name: Build and Release App-bundle +on: + push: + branches: + - develop + +jobs: + android-build: + name: Android main Build + runs-on: ubuntu-latest + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.12.1 + - name: Checkout repo from main branch + uses: actions/checkout@v4.0.0 + with: + ref: main + - name: Install npm dependency + run: npm install + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: '17' + - name: Setup Android SDK + uses: android-actions/setup-android@v3.0.0 + - uses: actions/cache@v4.0.0 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Setup Gradle + uses: gradle/gradle-build-action@v3 + - name: Decode Keystore + env: + KEYSTORE: ${{ secrets.KEYSTORE }} + MYAPP_UPLOAD_STORE_FILE: ${{ secrets.MYAPP_UPLOAD_STORE_FILE }} + run: | + cd android/app + echo $KEYSTORE > keystore-b64.txt + base64 -d keystore-b64.txt > $MYAPP_UPLOAD_STORE_FILE + - name: Build Release apk + env: + MYAPP_UPLOAD_STORE_FILE: ${{ secrets.MYAPP_UPLOAD_STORE_FILE }} + MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.MYAPP_UPLOAD_KEY_ALIAS }} + MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }} + MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }} + run: | + cd android + ./gradlew assembleRelease + - name: Build Release bundle + env: + MYAPP_UPLOAD_STORE_FILE: ${{ secrets.MYAPP_UPLOAD_STORE_FILE }} + MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.MYAPP_UPLOAD_KEY_ALIAS }} + MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }} + MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }} + run: | + cd android + ./gradlew bundleRelease