diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..70a62d4 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,44 @@ +name: Build commit + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install npm dependencies + run: npm ci + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Cache Gradle packages + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - name: Prepare Signing Files + env: + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + ALIAS: ${{ secrets.ALIAS }} + KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + run: | + ./tools/prepare-sign-for-ci.sh + - name: Build Release + id: buildRelease + run: | + cd android \ + && echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" >> local.properties \ + && ./gradlew assembleRelease bundleRelease + - name: Upload Artifacts + id: uploadArtifact + uses: actions/upload-artifact@v2 + with: + name: release + path: | + android/app/build/outputs/bundle/release/app-release.aab + android/app/build/outputs/apk/release/app-release.apk diff --git a/android/gradle.properties b/android/gradle.properties index 7336788..04ca0ef 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -26,8 +26,3 @@ android.enableJetifier=true # Version of flipper SDK to use with React Native FLIPPER_VERSION=0.37.0 - -MYAPP_RELEASE_STORE_FILE=my-release-key.keystore -MYAPP_RELEASE_KEY_ALIAS=my-key-alias -MYAPP_RELEASE_STORE_PASSWORD=wd2f7x3h -MYAPP_RELEASE_KEY_PASSWORD=wd2f7x3h diff --git a/tools/prepare-sign-for-ci.sh b/tools/prepare-sign-for-ci.sh new file mode 100755 index 0000000..32a3636 --- /dev/null +++ b/tools/prepare-sign-for-ci.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +echo "${SIGNING_KEY}" \ +| base64 -d > android/app/my-release-key.keystore + +cat <<-EOF >> android/gradle.properties + MYAPP_RELEASE_STORE_FILE=my-release-key.keystore + MYAPP_RELEASE_KEY_ALIAS=${ALIAS} + MYAPP_RELEASE_STORE_PASSWORD=${KEY_STORE_PASSWORD} + MYAPP_RELEASE_KEY_PASSWORD=${KEY_PASSWORD} +EOF \ No newline at end of file