From fb7387fb7d79ec1ed96f160ea2e17b35bf781fd6 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Tue, 18 Jul 2023 23:42:04 +0600 Subject: [PATCH 01/84] devops: internal testing v3 --- .github/workflows/develop-cd.yml | 5 ++--- android/app/build.gradle | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/develop-cd.yml b/.github/workflows/develop-cd.yml index 1467157..3cdc00e 100644 --- a/.github/workflows/develop-cd.yml +++ b/.github/workflows/develop-cd.yml @@ -148,7 +148,6 @@ jobs: releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} track: internal inAppUpdatePriority: 3 - status: draft - # userFraction: 0.5 + status: complete whatsNewDirectory: android/release-notes/ - releaseName: v1.0.1 + releaseName: v1.0.2 diff --git a/android/app/build.gradle b/android/app/build.gradle index 1306f82..bc7d08d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -91,8 +91,8 @@ android { applicationId "com.thebest.gamchha" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 2 - versionName "1.0.1" + versionCode 3 + versionName "1.0.2" // versionCode getVersionCode() // versionName getVersionName() } From 87e55a879d8324005822dea86976bf1c2a54283a Mon Sep 17 00:00:00 2001 From: dg1223 Date: Tue, 18 Jul 2023 23:43:33 +0600 Subject: [PATCH 02/84] devops: internal testing v3 --- .github/workflows/develop-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/develop-cd.yml b/.github/workflows/develop-cd.yml index 3cdc00e..a0a1a9f 100644 --- a/.github/workflows/develop-cd.yml +++ b/.github/workflows/develop-cd.yml @@ -148,6 +148,6 @@ jobs: releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} track: internal inAppUpdatePriority: 3 - status: complete + status: completed whatsNewDirectory: android/release-notes/ releaseName: v1.0.2 From 11871099cfb181b94eac3f6a9fc49af24ef559c4 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Tue, 18 Jul 2023 23:50:30 +0600 Subject: [PATCH 03/84] devops: updated release status to inProgress --- .github/workflows/develop-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/develop-cd.yml b/.github/workflows/develop-cd.yml index a0a1a9f..a8f5eef 100644 --- a/.github/workflows/develop-cd.yml +++ b/.github/workflows/develop-cd.yml @@ -148,6 +148,6 @@ jobs: releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} track: internal inAppUpdatePriority: 3 - status: completed + status: inProgress whatsNewDirectory: android/release-notes/ releaseName: v1.0.2 From c9eb5437eda36887e9065f1b9105a63c4e8a8478 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Tue, 18 Jul 2023 23:57:10 +0600 Subject: [PATCH 04/84] devops: added userFraction for inProgress status --- .github/workflows/develop-cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/develop-cd.yml b/.github/workflows/develop-cd.yml index a8f5eef..f3dd2c3 100644 --- a/.github/workflows/develop-cd.yml +++ b/.github/workflows/develop-cd.yml @@ -149,5 +149,6 @@ jobs: track: internal inAppUpdatePriority: 3 status: inProgress + userFraction: 0.5 whatsNewDirectory: android/release-notes/ releaseName: v1.0.2 From d4d85944f844bd67bf25dac194fab27047943301 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 18:35:46 +0600 Subject: [PATCH 05/84] run integration tests on push to develop branch only --- .github/workflows/ci.yml | 4 +--- .github/workflows/develop-cd.yml | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 144de02..d347110 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,9 @@ name: Continuous Integration on: - pull_request: + push: branches: - develop - - alpha - - main jobs: lint-and-test: diff --git a/.github/workflows/develop-cd.yml b/.github/workflows/develop-cd.yml index f3dd2c3..3a7b0b4 100644 --- a/.github/workflows/develop-cd.yml +++ b/.github/workflows/develop-cd.yml @@ -148,7 +148,7 @@ jobs: releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} track: internal inAppUpdatePriority: 3 - status: inProgress - userFraction: 0.5 + status: draft + # userFraction: 0.5 whatsNewDirectory: android/release-notes/ releaseName: v1.0.2 From b6186a3bff8dede86bca97d0c638cd79dde9e849 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 19:45:03 +0600 Subject: [PATCH 06/84] deploy only if integration tests pass --- .github/workflows/ci.yml | 21 ++++ .github/workflows/develop-cd copy.yml | 154 ++++++++++++++++++++++++++ .github/workflows/develop-cd.yml | 8 +- 3 files changed, 179 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/develop-cd copy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d347110..b987049 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,3 +43,24 @@ jobs: - name: Run tests run: npm run test + + trigger-cd-on-success: + needs: lint-and-test + if: success() + runs-on: ubuntu-latest + steps: + - name: Trigger CD Workflow + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + # This action internally uses the provided github-token to authenticate API requests. + # We use it to trigger the cd.yml workflow. + const response = await octokit.actions.createWorkflowDispatch({ + owner: 'dg1223', + repo: 'Gamchha', + workflow_id: 'develop-cd.yml', + ref: 'develop', + inputs: {} + }); + console.log(response); diff --git a/.github/workflows/develop-cd copy.yml b/.github/workflows/develop-cd copy.yml new file mode 100644 index 0000000..3a7b0b4 --- /dev/null +++ b/.github/workflows/develop-cd copy.yml @@ -0,0 +1,154 @@ +name: Dev Deployment + +on: + push: + branches: + - develop + +jobs: + dev-distribution: + runs-on: ubuntu-latest + + name: Development Distribution + env: + MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_ALIAS }} + MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + + steps: + - name: Checkout branch + uses: actions/checkout@v3 + + # Cache npm dependencies (from GitHub docs) + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + # If there's a cache miss + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + # Caching process complete + + - name: Install node dependencies + run: npm install + + - name: Lint check + run: npm run lint + + - name: Run tests + run: npm run test + + # - name: Read Version + # id: read-version + # run: | + # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" + # echo "::set-output name=versionName::$(jq -r '.versionName' version.json)" + + # # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" + # # echo "::set-output name=versionName::$(node -p -e "require('./version.json').versionName")" + + # - name: Increment Version + # id: increment-version + # run: | + # echo "::set-output name=versionCode::$(node -p \"parseInt('${{ steps.read-version.outputs.versionCode }}') + 1\")" + # echo "::set-output name=versionName::$(node -p \"'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))\")" + + # # echo "::set-output name=versionCode::$(node -p -e 'parseInt(${ steps.read-version.outputs.versionCode }) + 1')" + # # echo "::set-output name=versionName::$(node -p -e "'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))")" + + # - name: Update build.gradle + # run: | + # sed -i "s/versionCode .*/versionCode ${{ steps.increment-version.outputs.versionCode }}/" android/app/build.gradle + # sed -i "s/versionName .*/versionName '${{ steps.increment-version.outputs.versionName }}'/" android/app/build.gradle + + # - name: Commit and Push Changes + # uses: stefanzweifel/git-auto-commit-action@v4 + # with: + # commit_message: devops - update versionCode and versionName [skip ci] + + - name: Cache Gradle Wrapper + uses: actions/cache@v3 + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + + - name: Cache Gradle Dependencies + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: ${{ runner.os }}-gradle-caches- + + # Start the build process + - name: Make Gradlew Executable + run: | + cd android && chmod +x ./gradlew + + # - name: Generate App APK + # run: | + # cd android && ./gradlew assembleRelease --no-daemon + + # - name: Sign generated APK + # id: sign_app + # uses: r0adkll/sign-android-release@v1 + # with: + # releaseDirectory: android/app/build/outputs/apk/release + # signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} + # alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} + # keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + # keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + + # - name: Check app directory after signing (debug) + # run: | + # ls -a android/app/build/outputs/apk/release + + - name: Build Android App Bundle + run: cd android && ./gradlew bundleRelease --no-daemon + + - name: Sign App Bundle + id: sign_app + uses: r0adkll/sign-android-release@v1 + with: + releaseDirectory: android/app/build/outputs/bundle/release + signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} + alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} + keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: Signed App Bundle + path: ${{steps.sign_app.outputs.signedReleaseFile}} + + - name: Check directory (debug) + run: | + pwd + ls -a android/app/build/outputs/bundle/release + + - name: Deploy to Play Store (Internal testing) + uses: r0adkll/upload-google-play@v1 + with: + serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} + # The packageName must already exist in the play console account, so make sure you upload a manual apk or aab first through the console + # https://github.com/r0adkll/upload-google-play/tree/v1/ + packageName: com.thebest.gamchha + releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} + track: internal + inAppUpdatePriority: 3 + status: draft + # userFraction: 0.5 + whatsNewDirectory: android/release-notes/ + releaseName: v1.0.2 diff --git a/.github/workflows/develop-cd.yml b/.github/workflows/develop-cd.yml index 3a7b0b4..66d440d 100644 --- a/.github/workflows/develop-cd.yml +++ b/.github/workflows/develop-cd.yml @@ -1,9 +1,9 @@ name: Dev Deployment -on: - push: - branches: - - develop +# on: +# push: +# branches: +# - develop jobs: dev-distribution: From 7f5dd5a3e1b0e08eff67800fcbb6fd46066059d0 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 20:02:42 +0600 Subject: [PATCH 07/84] conditional ci/cd using a single workflow file --- .github/workflows/ci.yml | 123 ++++++++++++-- ...evelop-cd copy.yml => develop-cd copy.txt} | 0 .github/workflows/develop-cd.yml | 154 ------------------ 3 files changed, 108 insertions(+), 169 deletions(-) rename .github/workflows/{develop-cd copy.yml => develop-cd copy.txt} (100%) delete mode 100644 .github/workflows/develop-cd.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b987049..1ffb46f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,21 +46,114 @@ jobs: trigger-cd-on-success: needs: lint-and-test - if: success() + # default action is success() + # if: success() runs-on: ubuntu-latest + env: + MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_ALIAS }} + MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + steps: - - name: Trigger CD Workflow - uses: actions/github-script@v6 + # - name: Read Version + # id: read-version + # run: | + # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" + # echo "::set-output name=versionName::$(jq -r '.versionName' version.json)" + + # # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" + # # echo "::set-output name=versionName::$(node -p -e "require('./version.json').versionName")" + + # - name: Increment Version + # id: increment-version + # run: | + # echo "::set-output name=versionCode::$(node -p \"parseInt('${{ steps.read-version.outputs.versionCode }}') + 1\")" + # echo "::set-output name=versionName::$(node -p \"'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))\")" + + # # echo "::set-output name=versionCode::$(node -p -e 'parseInt(${ steps.read-version.outputs.versionCode }) + 1')" + # # echo "::set-output name=versionName::$(node -p -e "'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))")" + + # - name: Update build.gradle + # run: | + # sed -i "s/versionCode .*/versionCode ${{ steps.increment-version.outputs.versionCode }}/" android/app/build.gradle + # sed -i "s/versionName .*/versionName '${{ steps.increment-version.outputs.versionName }}'/" android/app/build.gradle + + # - name: Commit and Push Changes + # uses: stefanzweifel/git-auto-commit-action@v4 + # with: + # commit_message: devops - update versionCode and versionName [skip ci] + + - name: Cache Gradle Wrapper + uses: actions/cache@v3 + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + + - name: Cache Gradle Dependencies + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: ${{ runner.os }}-gradle-caches- + + # Start the build process + - name: Make Gradlew Executable + run: | + cd android && chmod +x ./gradlew + + # - name: Generate App APK + # run: | + # cd android && ./gradlew assembleRelease --no-daemon + + # - name: Sign generated APK + # id: sign_app + # uses: r0adkll/sign-android-release@v1 + # with: + # releaseDirectory: android/app/build/outputs/apk/release + # signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} + # alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} + # keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + # keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + + # - name: Check app directory after signing (debug) + # run: | + # ls -a android/app/build/outputs/apk/release + + - name: Build Android App Bundle + run: cd android && ./gradlew bundleRelease --no-daemon + + - name: Sign App Bundle + id: sign_app + uses: r0adkll/sign-android-release@v1 + with: + releaseDirectory: android/app/build/outputs/bundle/release + signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} + alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} + keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: Signed App Bundle + path: ${{steps.sign_app.outputs.signedReleaseFile}} + + - name: Check directory (debug) + run: | + pwd + ls -a android/app/build/outputs/bundle/release + + - name: Deploy to Play Store (Internal testing) + uses: r0adkll/upload-google-play@v1 with: - github-token: ${{ secrets.GH_TOKEN }} - script: | - # This action internally uses the provided github-token to authenticate API requests. - # We use it to trigger the cd.yml workflow. - const response = await octokit.actions.createWorkflowDispatch({ - owner: 'dg1223', - repo: 'Gamchha', - workflow_id: 'develop-cd.yml', - ref: 'develop', - inputs: {} - }); - console.log(response); + serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} + # The packageName must already exist in the play console account, so make sure you upload a manual apk or aab first through the console + # https://github.com/r0adkll/upload-google-play/tree/v1/ + packageName: com.thebest.gamchha + releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} + track: internal + inAppUpdatePriority: 3 + status: draft + # userFraction: 0.5 + whatsNewDirectory: android/release-notes/ + releaseName: v1.0.2 diff --git a/.github/workflows/develop-cd copy.yml b/.github/workflows/develop-cd copy.txt similarity index 100% rename from .github/workflows/develop-cd copy.yml rename to .github/workflows/develop-cd copy.txt diff --git a/.github/workflows/develop-cd.yml b/.github/workflows/develop-cd.yml deleted file mode 100644 index 66d440d..0000000 --- a/.github/workflows/develop-cd.yml +++ /dev/null @@ -1,154 +0,0 @@ -name: Dev Deployment - -# on: -# push: -# branches: -# - develop - -jobs: - dev-distribution: - runs-on: ubuntu-latest - - name: Development Distribution - env: - MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_ALIAS }} - MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - steps: - - name: Checkout branch - uses: actions/checkout@v3 - - # Cache npm dependencies (from GitHub docs) - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - # If there's a cache miss - - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: npm list - # Caching process complete - - - name: Install node dependencies - run: npm install - - - name: Lint check - run: npm run lint - - - name: Run tests - run: npm run test - - # - name: Read Version - # id: read-version - # run: | - # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" - # echo "::set-output name=versionName::$(jq -r '.versionName' version.json)" - - # # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" - # # echo "::set-output name=versionName::$(node -p -e "require('./version.json').versionName")" - - # - name: Increment Version - # id: increment-version - # run: | - # echo "::set-output name=versionCode::$(node -p \"parseInt('${{ steps.read-version.outputs.versionCode }}') + 1\")" - # echo "::set-output name=versionName::$(node -p \"'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))\")" - - # # echo "::set-output name=versionCode::$(node -p -e 'parseInt(${ steps.read-version.outputs.versionCode }) + 1')" - # # echo "::set-output name=versionName::$(node -p -e "'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))")" - - # - name: Update build.gradle - # run: | - # sed -i "s/versionCode .*/versionCode ${{ steps.increment-version.outputs.versionCode }}/" android/app/build.gradle - # sed -i "s/versionName .*/versionName '${{ steps.increment-version.outputs.versionName }}'/" android/app/build.gradle - - # - name: Commit and Push Changes - # uses: stefanzweifel/git-auto-commit-action@v4 - # with: - # commit_message: devops - update versionCode and versionName [skip ci] - - - name: Cache Gradle Wrapper - uses: actions/cache@v3 - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - - - name: Cache Gradle Dependencies - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - restore-keys: ${{ runner.os }}-gradle-caches- - - # Start the build process - - name: Make Gradlew Executable - run: | - cd android && chmod +x ./gradlew - - # - name: Generate App APK - # run: | - # cd android && ./gradlew assembleRelease --no-daemon - - # - name: Sign generated APK - # id: sign_app - # uses: r0adkll/sign-android-release@v1 - # with: - # releaseDirectory: android/app/build/outputs/apk/release - # signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} - # alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} - # keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - # keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - # - name: Check app directory after signing (debug) - # run: | - # ls -a android/app/build/outputs/apk/release - - - name: Build Android App Bundle - run: cd android && ./gradlew bundleRelease --no-daemon - - - name: Sign App Bundle - id: sign_app - uses: r0adkll/sign-android-release@v1 - with: - releaseDirectory: android/app/build/outputs/bundle/release - signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} - alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} - keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: Signed App Bundle - path: ${{steps.sign_app.outputs.signedReleaseFile}} - - - name: Check directory (debug) - run: | - pwd - ls -a android/app/build/outputs/bundle/release - - - name: Deploy to Play Store (Internal testing) - uses: r0adkll/upload-google-play@v1 - with: - serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} - # The packageName must already exist in the play console account, so make sure you upload a manual apk or aab first through the console - # https://github.com/r0adkll/upload-google-play/tree/v1/ - packageName: com.thebest.gamchha - releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} - track: internal - inAppUpdatePriority: 3 - status: draft - # userFraction: 0.5 - whatsNewDirectory: android/release-notes/ - releaseName: v1.0.2 From 861ed7690e0cd2a0a3655e7c3004727d9eba94d9 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 20:07:16 +0600 Subject: [PATCH 08/84] fix: debug step Make Gradlew Executable --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ffb46f..26cf9c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,6 +99,8 @@ jobs: # Start the build process - name: Make Gradlew Executable run: | + pwd + ls -a cd android && chmod +x ./gradlew # - name: Generate App APK From 8e053242b0d3c7fc7a0b606987785f1d92c72362 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 20:11:21 +0600 Subject: [PATCH 09/84] fix: added checkout branch step --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26cf9c1..6a1e90e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,9 @@ jobs: MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} steps: + - name: Checkout branch + uses: actions/checkout@v3 + # - name: Read Version # id: read-version # run: | From 65e5f72c954159ab7b9562f21f292c9951e08d25 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 20:29:06 +0600 Subject: [PATCH 10/84] fix: check contents in runner android directory --- .github/workflows/{ci.yml => ci-cd-develop.yml} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename .github/workflows/{ci.yml => ci-cd-develop.yml} (97%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-cd-develop.yml similarity index 97% rename from .github/workflows/ci.yml rename to .github/workflows/ci-cd-develop.yml index 6a1e90e..0a84868 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -125,7 +125,9 @@ jobs: # ls -a android/app/build/outputs/apk/release - name: Build Android App Bundle - run: cd android && ./gradlew bundleRelease --no-daemon + run: | + ls -a /home/runner/work/Gamchha/Gamchha + cd android && ./gradlew bundleRelease --no-daemon - name: Sign App Bundle id: sign_app From fa092887d1cc145ed40b9814a61a1151e8bd88f4 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 20:34:25 +0600 Subject: [PATCH 11/84] fix: install node dependencies on the deployment runner --- .github/workflows/ci-cd-develop.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 0a84868..9ce14d5 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -55,9 +55,37 @@ jobs: MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} steps: + # We need to checkout the current branch and install node + # dependencies again because every GH Actions job runs on + # a seperate runner (VM) - name: Checkout branch uses: actions/checkout@v3 + # Cache npm dependencies (from GitHub docs) + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + # If there's a cache miss + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + # Caching process complete + + - name: Install dependencies + run: npm install + # - name: Read Version # id: read-version # run: | From 9f30aa4609659b40351b38431199ced8ad4a18d7 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 20:40:30 +0600 Subject: [PATCH 12/84] devops: renamed jobs --- .github/workflows/ci-cd-develop.yml | 19 +++++++------------ android/app/build.gradle | 4 ++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 9ce14d5..eb336c2 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -1,4 +1,4 @@ -name: Continuous Integration +name: Dev CI/CD on: push: @@ -6,7 +6,7 @@ on: - develop jobs: - lint-and-test: + test: runs-on: ubuntu-latest steps: @@ -44,8 +44,8 @@ jobs: - name: Run tests run: npm run test - trigger-cd-on-success: - needs: lint-and-test + deploy: + needs: test # default action is success() # if: success() runs-on: ubuntu-latest @@ -129,10 +129,7 @@ jobs: # Start the build process - name: Make Gradlew Executable - run: | - pwd - ls -a - cd android && chmod +x ./gradlew + run: cd android && chmod +x ./gradlew # - name: Generate App APK # run: | @@ -153,9 +150,7 @@ jobs: # ls -a android/app/build/outputs/apk/release - name: Build Android App Bundle - run: | - ls -a /home/runner/work/Gamchha/Gamchha - cd android && ./gradlew bundleRelease --no-daemon + run: cd android && ./gradlew bundleRelease --no-daemon - name: Sign App Bundle id: sign_app @@ -191,4 +186,4 @@ jobs: status: draft # userFraction: 0.5 whatsNewDirectory: android/release-notes/ - releaseName: v1.0.2 + releaseName: v1.0.3 diff --git a/android/app/build.gradle b/android/app/build.gradle index bc7d08d..ba89bda 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -91,8 +91,8 @@ android { applicationId "com.thebest.gamchha" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 3 - versionName "1.0.2" + versionCode 4 + versionName "1.0.3" // versionCode getVersionCode() // versionName getVersionName() } From 8ab20102378bd35b1d586df2fa818dbe1f804a43 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:04:26 +0600 Subject: [PATCH 13/84] devops: Dev CI/CD badge; don't run CI/CD if only README.md is updated --- .../{develop-cd copy.txt => alpha-cd.txt} | 0 .github/workflows/ci-cd-develop.yml | 25 ++++++++++++++----- README.md | 3 +-- android/app/build.gradle | 4 +-- 4 files changed, 22 insertions(+), 10 deletions(-) rename .github/workflows/{develop-cd copy.txt => alpha-cd.txt} (100%) diff --git a/.github/workflows/develop-cd copy.txt b/.github/workflows/alpha-cd.txt similarity index 100% rename from .github/workflows/develop-cd copy.txt rename to .github/workflows/alpha-cd.txt diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index eb336c2..92f2e18 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -6,6 +6,24 @@ on: - develop jobs: + # Don't run CI/CD if only README.md is updated + check_readme_changes: + runs-on: ubuntu-latest + + steps: + - name: Checkout branch + uses: actions/checkout@v3 + + - name: Check for README changes + id: check-readme-changes + run: | + if [[ $(git diff --name-only ${{ github.event.before }}...${{ github.sha }} | grep -vE '^README\.md$') == "" ]] && [[ -n $(git diff --name-only ${{ github.event.before }}...${{ github.sha }} | grep -E '^README\.md$') ]]; then + echo "Only README.md file has been updated. Skipping the CI/CD workflow." + exit 0 + fi + echo "Changes to files other than README.md detected. Proceeding with the CI/CD workflow." + continue-on-error: true + test: runs-on: ubuntu-latest @@ -168,11 +186,6 @@ jobs: name: Signed App Bundle path: ${{steps.sign_app.outputs.signedReleaseFile}} - - name: Check directory (debug) - run: | - pwd - ls -a android/app/build/outputs/bundle/release - - name: Deploy to Play Store (Internal testing) uses: r0adkll/upload-google-play@v1 with: @@ -186,4 +199,4 @@ jobs: status: draft # userFraction: 0.5 whatsNewDirectory: android/release-notes/ - releaseName: v1.0.3 + releaseName: v1.0.4 diff --git a/README.md b/README.md index 1f5396e..2ae0abd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![Continuous Integration](https://github.com/dg1223/Gamchha/actions/workflows/ci.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci.yml) -[![Dev Deployment](https://github.com/dg1223/Gamchha/actions/workflows/develop-cd.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/develop-cd.yml) +[![Dev CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml) This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). diff --git a/android/app/build.gradle b/android/app/build.gradle index ba89bda..494f741 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -91,8 +91,8 @@ android { applicationId "com.thebest.gamchha" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 4 - versionName "1.0.3" + versionCode 5 + versionName "1.0.4" // versionCode getVersionCode() // versionName getVersionName() } From 6456904403a88995e13fcbde996102289e72e8ba Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:12:01 +0600 Subject: [PATCH 14/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 92f2e18..69754a8 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -17,14 +17,15 @@ jobs: - name: Check for README changes id: check-readme-changes run: | - if [[ $(git diff --name-only ${{ github.event.before }}...${{ github.sha }} | grep -vE '^README\.md$') == "" ]] && [[ -n $(git diff --name-only ${{ github.event.before }}...${{ github.sha }} | grep -E '^README\.md$') ]]; then - echo "Only README.md file has been updated. Skipping the CI/CD workflow." + if [[ $(git diff --name-only ${{ github.event.before }}...${{ github.sha }} | grep -vE '^(README\.md|.*\.yml)$') == "" && $(git diff --name-only ${{ github.event.before }}...${{ github.sha }} | grep -E '^(README\.md|.*\.yml)$') != "" ]]; then + echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." exit 0 fi - echo "Changes to files other than README.md detected. Proceeding with the CI/CD workflow." + echo "Changes to files other than README.md or *.yml detected. Proceeding with the CI/CD workflow." continue-on-error: true test: + needs: check_readme_changes runs-on: ubuntu-latest steps: From 00ad105abe4a1d528c324420bec13ca477c7a7ce Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:15:16 +0600 Subject: [PATCH 15/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 69754a8..d972324 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -17,7 +17,7 @@ jobs: - name: Check for README changes id: check-readme-changes run: | - if [[ $(git diff --name-only ${{ github.event.before }}...${{ github.sha }} | grep -vE '^(README\.md|.*\.yml)$') == "" && $(git diff --name-only ${{ github.event.before }}...${{ github.sha }} | grep -E '^(README\.md|.*\.yml)$') != "" ]]; then + if [[ $(git diff --name-only ${GITHUB_BASE_REF}..${GITHUB_HEAD_REF} | grep -vE '^(README\.md|.*\.yml)$') == "" && $(git diff --name-only ${GITHUB_BASE_REF}..${GITHUB_HEAD_REF} | grep -E '^(README\.md|.*\.yml)$') != "" ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." exit 0 fi From 844cc2030998d85e9ccda1aca8b22d14b21542b4 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:17:01 +0600 Subject: [PATCH 16/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index d972324..5de0470 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -17,7 +17,7 @@ jobs: - name: Check for README changes id: check-readme-changes run: | - if [[ $(git diff --name-only ${GITHUB_BASE_REF}..${GITHUB_HEAD_REF} | grep -vE '^(README\.md|.*\.yml)$') == "" && $(git diff --name-only ${GITHUB_BASE_REF}..${GITHUB_HEAD_REF} | grep -E '^(README\.md|.*\.yml)$') != "" ]]; then + if [[ $(git diff --name-only ${github.event.before}..${github.sha} | grep -vE '^(README\.md|.*\.yml)$') == "" && $(git diff --name-only ${github.event.before}..${github.sha} | grep -E '^(README\.md|.*\.yml)$') != "" ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." exit 0 fi From ae121f3837900c57c51f275e86136ea5dfa41525 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:19:29 +0600 Subject: [PATCH 17/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 5de0470..2191b21 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -17,7 +17,7 @@ jobs: - name: Check for README changes id: check-readme-changes run: | - if [[ $(git diff --name-only ${github.event.before}..${github.sha} | grep -vE '^(README\.md|.*\.yml)$') == "" && $(git diff --name-only ${github.event.before}..${github.sha} | grep -E '^(README\.md|.*\.yml)$') != "" ]]; then + if [[ $(git diff --name-only ${{ github.event.before }}..${{ github.sha }} | grep -vE '^(README\.md|.*\.yml)$') == "" && $(git diff --name-only ${{ github.event.before }}..${{ github.sha }} | grep -E '^(README\.md|.*\.yml)$') != "" ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." exit 0 fi From 2c81f2c42fd77885468f4d1bde822ed781187e10 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:21:04 +0600 Subject: [PATCH 18/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 2191b21..5e947dc 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -17,7 +17,7 @@ jobs: - name: Check for README changes id: check-readme-changes run: | - if [[ $(git diff --name-only ${{ github.event.before }}..${{ github.sha }} | grep -vE '^(README\.md|.*\.yml)$') == "" && $(git diff --name-only ${{ github.event.before }}..${{ github.sha }} | grep -E '^(README\.md|.*\.yml)$') != "" ]]; then + if [[ $(git diff --name-only HEAD^..HEAD | grep -vE '^(README\.md|.*\.yml)$') == "" && $(git diff --name-only HEAD^..HEAD | grep -E '^(README\.md|.*\.yml)$') != "" ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." exit 0 fi From bd5aa4b74a5efdc8b4fd46f28feffde83602348c Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:22:59 +0600 Subject: [PATCH 19/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 5e947dc..f079364 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -17,7 +17,7 @@ jobs: - name: Check for README changes id: check-readme-changes run: | - if [[ $(git diff --name-only HEAD^..HEAD | grep -vE '^(README\.md|.*\.yml)$') == "" && $(git diff --name-only HEAD^..HEAD | grep -E '^(README\.md|.*\.yml)$') != "" ]]; then + if [[ $(git log -m -1 --name-only --pretty='' --first-parent HEAD) == $(git log -m -1 --name-only --pretty='' --first-parent HEAD^) && $(git log -m -1 --name-only --pretty='' --first-parent HEAD) =~ ^(README\.md|.*\.yml)$ ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." exit 0 fi From 373dbfb3ab618455229e363bdc104fa61b5a96a9 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:25:23 +0600 Subject: [PATCH 20/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index f079364..d81e257 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -17,7 +17,9 @@ jobs: - name: Check for README changes id: check-readme-changes run: | - if [[ $(git log -m -1 --name-only --pretty='' --first-parent HEAD) == $(git log -m -1 --name-only --pretty='' --first-parent HEAD^) && $(git log -m -1 --name-only --pretty='' --first-parent HEAD) =~ ^(README\.md|.*\.yml)$ ]]; then + git diff-tree --no-commit-id --name-only -r $(git rev-parse HEAD) | grep -vE '^(README\.md|.*\.yml)$' + CHANGED_FILES=$? + if [ $CHANGED_FILES -eq 1 ]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." exit 0 fi From 6f2cfa131a89c801c7d3f450b92c631590b54ae6 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:27:29 +0600 Subject: [PATCH 21/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index d81e257..b683e5a 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -17,9 +17,11 @@ jobs: - name: Check for README changes id: check-readme-changes run: | - git diff-tree --no-commit-id --name-only -r $(git rev-parse HEAD) | grep -vE '^(README\.md|.*\.yml)$' - CHANGED_FILES=$? - if [ $CHANGED_FILES -eq 1 ]; then + # Get the list of changed files for the current commit and its parent commit + CHANGED_FILES=$(git diff --name-only HEAD^..HEAD) + + # Check if 'README.md' or '.yml' files are the only files changed + if [[ $CHANGED_FILES =~ ^(README\.md|.*\.yml)$ && ! $CHANGED_FILES =~ [^[:space:]] ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." exit 0 fi From d25f7bfe98fa4a4db7147c462530e198d3e1eff8 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:29:20 +0600 Subject: [PATCH 22/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index b683e5a..d0b4a7e 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -17,8 +17,12 @@ jobs: - name: Check for README changes id: check-readme-changes run: | + # Get the SHA of the current commit (HEAD) and its parent commit (HEAD^) + CURRENT_COMMIT=$(git rev-parse HEAD) + PARENT_COMMIT=$(git rev-parse HEAD^) + # Get the list of changed files for the current commit and its parent commit - CHANGED_FILES=$(git diff --name-only HEAD^..HEAD) + CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r $CURRENT_COMMIT $PARENT_COMMIT) # Check if 'README.md' or '.yml' files are the only files changed if [[ $CHANGED_FILES =~ ^(README\.md|.*\.yml)$ && ! $CHANGED_FILES =~ [^[:space:]] ]]; then From 0f9c9c67ac8f4ae2c057350d4009c58bdcb15c8f Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:30:36 +0600 Subject: [PATCH 23/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index d0b4a7e..a86b6dd 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -17,12 +17,8 @@ jobs: - name: Check for README changes id: check-readme-changes run: | - # Get the SHA of the current commit (HEAD) and its parent commit (HEAD^) - CURRENT_COMMIT=$(git rev-parse HEAD) - PARENT_COMMIT=$(git rev-parse HEAD^) - - # Get the list of changed files for the current commit and its parent commit - CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r $CURRENT_COMMIT $PARENT_COMMIT) + # Get the list of changed files between the base and head branches + CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) # Check if 'README.md' or '.yml' files are the only files changed if [[ $CHANGED_FILES =~ ^(README\.md|.*\.yml)$ && ! $CHANGED_FILES =~ [^[:space:]] ]]; then From f6cda0580ac4ee2a34f80e799cb1e73e37e528f4 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:31:49 +0600 Subject: [PATCH 24/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index a86b6dd..5118d86 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -19,6 +19,7 @@ jobs: run: | # Get the list of changed files between the base and head branches CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) + echo $CHANGED_FILES # Check if 'README.md' or '.yml' files are the only files changed if [[ $CHANGED_FILES =~ ^(README\.md|.*\.yml)$ && ! $CHANGED_FILES =~ [^[:space:]] ]]; then From 60afa43fa03020bc687eb4d46be81d5803ea1157 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 23 Jul 2023 22:34:56 +0600 Subject: [PATCH 25/84] devops: don't run CI/CD if only README.md or any .yml file is updated --- .github/workflows/ci-cd-develop.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 5118d86..1c2d524 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -19,10 +19,9 @@ jobs: run: | # Get the list of changed files between the base and head branches CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) - echo $CHANGED_FILES # Check if 'README.md' or '.yml' files are the only files changed - if [[ $CHANGED_FILES =~ ^(README\.md|.*\.yml)$ && ! $CHANGED_FILES =~ [^[:space:]] ]]; then + if [[ $CHANGED_FILES =~ ^(README\.md|.*\.yml)$ && ! $CHANGED_FILES =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." exit 0 fi From c3afe62fdf379a86f6a55c3ae5ab409d53864e24 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 11:44:23 +0600 Subject: [PATCH 26/84] devops: alpha-cd updated --- .github/workflows/alpha-cd.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha-cd.txt b/.github/workflows/alpha-cd.txt index 3a7b0b4..9d44fce 100644 --- a/.github/workflows/alpha-cd.txt +++ b/.github/workflows/alpha-cd.txt @@ -1,9 +1,9 @@ -name: Dev Deployment +name: Alpha Deployment on: push: branches: - - develop + - alpha jobs: dev-distribution: From a6709bf3dbe4becb9b1b5fa7ee777b0fde9bab47 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 11:59:48 +0600 Subject: [PATCH 27/84] fix: removed github variables from git diff command --- .github/workflows/ci-cd-develop.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 1c2d524..65bd29a 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -18,7 +18,9 @@ jobs: id: check-readme-changes run: | # Get the list of changed files between the base and head branches - CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) + # CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) + CHANGED_FILES=$(git diff --name-only) + echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed if [[ $CHANGED_FILES =~ ^(README\.md|.*\.yml)$ && ! $CHANGED_FILES =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then From aaa110f7c03c47b2e119a2c1ea03b4814f64833d Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 12:04:17 +0600 Subject: [PATCH 28/84] fix: check git diff output directly --- .github/workflows/ci-cd-develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 65bd29a..4fb7b29 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -19,6 +19,7 @@ jobs: run: | # Get the list of changed files between the base and head branches # CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) + git diff --name-only CHANGED_FILES=$(git diff --name-only) echo ${CHANGED_FILES} From 996eafaefbfa7ada3376ef4f37194ba808d74143 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 12:54:10 +0600 Subject: [PATCH 29/84] fix: use git log instead of git diff to see changed file names --- .github/workflows/ci-cd-develop.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 4fb7b29..3aaa05b 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -19,8 +19,7 @@ jobs: run: | # Get the list of changed files between the base and head branches # CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) - git diff --name-only - CHANGED_FILES=$(git diff --name-only) + CHANGED_FILES=$(git log -1 --name-only --pretty=format:'') echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed From 64c078132b6cee5f2caec844627cb663ca508ff9 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 13:13:53 +0600 Subject: [PATCH 30/84] fix: get the list of changed files in the latest commit --- .github/workflows/ci-cd-develop.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 3aaa05b..5f9fad0 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -19,11 +19,12 @@ jobs: run: | # Get the list of changed files between the base and head branches # CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) - CHANGED_FILES=$(git log -1 --name-only --pretty=format:'') + CURRENT_COMMIT=$(git rev-parse HEAD) + CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r ${CURRENT_COMMIT}) echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed - if [[ $CHANGED_FILES =~ ^(README\.md|.*\.yml)$ && ! $CHANGED_FILES =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then + if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." exit 0 fi From 965e5b85c9873f89984552f39c788d0f8750436d Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 13:20:13 +0600 Subject: [PATCH 31/84] debug: display latest commit SHA --- .github/workflows/ci-cd-develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 5f9fad0..3ddd8fe 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -20,6 +20,7 @@ jobs: # Get the list of changed files between the base and head branches # CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) CURRENT_COMMIT=$(git rev-parse HEAD) + echo ${CURRENT_COMMIT} CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r ${CURRENT_COMMIT}) echo ${CHANGED_FILES} From aa79e4efaacd462c61ea44058a133f59fcf09fb6 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 13:26:28 +0600 Subject: [PATCH 32/84] debug: output debug info to file --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 3ddd8fe..2bbca94 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -22,7 +22,7 @@ jobs: CURRENT_COMMIT=$(git rev-parse HEAD) echo ${CURRENT_COMMIT} CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r ${CURRENT_COMMIT}) - echo ${CHANGED_FILES} + echo ${CHANGED_FILES} > changed_files.txt # Check if 'README.md' or '.yml' files are the only files changed if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then From ffe1d6e749816c5f694321e6ff97efa0c442d401 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 13:28:54 +0600 Subject: [PATCH 33/84] debug: output debug info to file and cat the file --- .github/workflows/ci-cd-develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 2bbca94..f753c2b 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -23,6 +23,7 @@ jobs: echo ${CURRENT_COMMIT} CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r ${CURRENT_COMMIT}) echo ${CHANGED_FILES} > changed_files.txt + cat changed_files.txt # Check if 'README.md' or '.yml' files are the only files changed if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then From 47cf7aeb27a528aaf3c249e43814681ac0fc87e8 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 13:34:34 +0600 Subject: [PATCH 34/84] fix: do not use git diff-tree --- .github/workflows/ci-cd-develop.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index f753c2b..ed32172 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -21,9 +21,8 @@ jobs: # CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) CURRENT_COMMIT=$(git rev-parse HEAD) echo ${CURRENT_COMMIT} - CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r ${CURRENT_COMMIT}) - echo ${CHANGED_FILES} > changed_files.txt - cat changed_files.txt + CHANGED_FILES=$(git diff --name-only HEAD^..HEAD) + echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then From 5ad04373e8a3a3f6079c2e79df5b8f112724e77d Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 13:39:05 +0600 Subject: [PATCH 35/84] fix: simplify commit path --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index ed32172..5f39861 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -21,7 +21,7 @@ jobs: # CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) CURRENT_COMMIT=$(git rev-parse HEAD) echo ${CURRENT_COMMIT} - CHANGED_FILES=$(git diff --name-only HEAD^..HEAD) + CHANGED_FILES=$(git diff --name-only HEAD^) echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed From 826fcbbf68520052c81cf46fa92dd289b8c161b8 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 13:47:03 +0600 Subject: [PATCH 36/84] fix: use github context --- .github/workflows/ci-cd-develop.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 5f39861..84318cd 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -18,10 +18,7 @@ jobs: id: check-readme-changes run: | # Get the list of changed files between the base and head branches - # CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }}) - CURRENT_COMMIT=$(git rev-parse HEAD) - echo ${CURRENT_COMMIT} - CHANGED_FILES=$(git diff --name-only HEAD^) + CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}...${{ github.sha }}) echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed From beed3e443d3651357ec470662e7292b6ad9e25de Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 13:50:03 +0600 Subject: [PATCH 37/84] fix: use github context before and after --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 84318cd..5650fc0 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -18,7 +18,7 @@ jobs: id: check-readme-changes run: | # Get the list of changed files between the base and head branches - CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}...${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed From 4498de64665ed274a4354906772d62922f2ffba8 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 13:53:23 +0600 Subject: [PATCH 38/84] fix: setting fetch depth to zero --- .github/workflows/ci-cd-develop.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 5650fc0..e68c3e0 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout branch uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Check for README changes id: check-readme-changes From 84f339a53c34f7b92dbb29b53f4f5bc5d3ab3719 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 14:04:59 +0600 Subject: [PATCH 39/84] fix: return instead of exit when condition is met --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index e68c3e0..75aca91 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -26,7 +26,7 @@ jobs: # Check if 'README.md' or '.yml' files are the only files changed if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." - exit 0 + return 0 fi echo "Changes to files other than README.md or *.yml detected. Proceeding with the CI/CD workflow." continue-on-error: true From 9f45d5ce8191958312918db13e92e433e23803e2 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 14:07:32 +0600 Subject: [PATCH 40/84] fix: do not continue on error --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 75aca91..42dbe54 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -29,7 +29,7 @@ jobs: return 0 fi echo "Changes to files other than README.md or *.yml detected. Proceeding with the CI/CD workflow." - continue-on-error: true + # continue-on-error: true test: needs: check_readme_changes From ef93a77f17db31879fab1b00bd814197abb8f1fc Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 15:34:55 +0600 Subject: [PATCH 41/84] devops: add success flag for first job --- .github/workflows/ci-cd-develop.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 42dbe54..6454801 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -7,8 +7,10 @@ on: jobs: # Don't run CI/CD if only README.md is updated - check_readme_changes: + check_readme_yml_changes: runs-on: ubuntu-latest + outputs: + run_rest_jobs: ${{ steps.set_output.outputs.run_jobs }} steps: - name: Checkout branch @@ -17,22 +19,26 @@ jobs: fetch-depth: 0 - name: Check for README changes - id: check-readme-changes + id: set_output run: | # Get the list of changed files between the base and head branches CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) - echo ${CHANGED_FILES} + echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." - return 0 + echo "::set-output name=run_jobs::false" + else + echo "Changes to files other than README.md or *.yml detected. Proceeding with the CI/CD workflow." + echo "::set-output name=run_jobs::true" fi - echo "Changes to files other than README.md or *.yml detected. Proceeding with the CI/CD workflow." + # continue-on-error: true test: - needs: check_readme_changes + needs: check_readme_yml_changes + if: needs.check_readme_yml_changes.outputs.run_rest_jobs == 'true' runs-on: ubuntu-latest steps: @@ -72,8 +78,7 @@ jobs: deploy: needs: test - # default action is success() - # if: success() + # default action is success(): if(success) runs-on: ubuntu-latest env: MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_ALIAS }} From c4f66c1cde770f8ae43b76833f87651760e23522 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 15:57:28 +0600 Subject: [PATCH 42/84] devops: using env variables instead of set_output to suppress deprecation warning --- .github/workflows/ci-cd-develop.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 6454801..9205554 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -6,7 +6,7 @@ on: - develop jobs: - # Don't run CI/CD if only README.md is updated + # Don't run CI/CD if only README.md and/or any .yml file is updated check_readme_yml_changes: runs-on: ubuntu-latest outputs: @@ -23,19 +23,16 @@ jobs: run: | # Get the list of changed files between the base and head branches CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) - echo ${CHANGED_FILES} - # Check if 'README.md' or '.yml' files are the only files changed if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." - echo "::set-output name=run_jobs::false" + # GITHUB_OUTPUT is a default GitHub env. variable + echo "run_jobs=false" >> ${GITHUB_OUTPUT} else echo "Changes to files other than README.md or *.yml detected. Proceeding with the CI/CD workflow." - echo "::set-output name=run_jobs::true" + echo "run_jobs=true" >> ${GITHUB_OUTPUT} fi - # continue-on-error: true - test: needs: check_readme_yml_changes if: needs.check_readme_yml_changes.outputs.run_rest_jobs == 'true' From 73827a585366437bbf8ece964c0b835965aa0545 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 16:35:47 +0600 Subject: [PATCH 43/84] devops: added .txt to list of files --- .github/workflows/alpha-cd.txt | 7 +------ .github/workflows/ci-cd-develop.yml | 8 ++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/alpha-cd.txt b/.github/workflows/alpha-cd.txt index 9d44fce..050cfcc 100644 --- a/.github/workflows/alpha-cd.txt +++ b/.github/workflows/alpha-cd.txt @@ -133,11 +133,6 @@ jobs: name: Signed App Bundle path: ${{steps.sign_app.outputs.signedReleaseFile}} - - name: Check directory (debug) - run: | - pwd - ls -a android/app/build/outputs/bundle/release - - name: Deploy to Play Store (Internal testing) uses: r0adkll/upload-google-play@v1 with: @@ -151,4 +146,4 @@ jobs: status: draft # userFraction: 0.5 whatsNewDirectory: android/release-notes/ - releaseName: v1.0.2 + releaseName: v1.0.4 diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 9205554..927e154 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -18,18 +18,18 @@ jobs: with: fetch-depth: 0 - - name: Check for README changes + - name: Check for README, yml or txt changes id: set_output run: | # Get the list of changed files between the base and head branches CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) # Check if 'README.md' or '.yml' files are the only files changed - if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml)).*$ ]]; then - echo "Only README.md or .yml files have been updated. Skipping the CI/CD workflow." + if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt)).*$ ]]; then + echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." # GITHUB_OUTPUT is a default GitHub env. variable echo "run_jobs=false" >> ${GITHUB_OUTPUT} else - echo "Changes to files other than README.md or *.yml detected. Proceeding with the CI/CD workflow." + echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." echo "run_jobs=true" >> ${GITHUB_OUTPUT} fi From 207f93be0043859a3a2b0fb6f9cf58308d26d199 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 17:20:34 +0600 Subject: [PATCH 44/84] devops: added firebase app distribution workflow --- .github/workflows/ci-cd-develop.yml | 53 +++++++++++++++++------------ 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 927e154..fc84be9 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -7,7 +7,7 @@ on: jobs: # Don't run CI/CD if only README.md and/or any .yml file is updated - check_readme_yml_changes: + check_readme_yml_txt_changes: runs-on: ubuntu-latest outputs: run_rest_jobs: ${{ steps.set_output.outputs.run_jobs }} @@ -34,8 +34,8 @@ jobs: fi test: - needs: check_readme_yml_changes - if: needs.check_readme_yml_changes.outputs.run_rest_jobs == 'true' + needs: check_readme_yml_txt_changes + if: needs.check_readme_yml_txt_changes.outputs.run_rest_jobs == 'true' runs-on: ubuntu-latest steps: @@ -190,23 +190,34 @@ jobs: keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - name: Upload Artifact - uses: actions/upload-artifact@v3 + ## Distribute app to Firebase App Distribution for testing + ## Use google play internal track if you have a google play account + ## (uncomment the sections below if you want to use Play Store) + - name: upload artifact to Firebase App Distribution + uses: wzieba/Firebase-Distribution-Github-Action@v1 with: - name: Signed App Bundle - path: ${{steps.sign_app.outputs.signedReleaseFile}} + appId: ${{secrets.ANDROID_FIREBASE_APP_ID}} + token: ${{secrets.ANDROID_FIREBASE_TOKEN}} + groups: testers + file: ${{steps.sign_app.outputs.signedReleaseFile}} - - name: Deploy to Play Store (Internal testing) - uses: r0adkll/upload-google-play@v1 - with: - serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} - # The packageName must already exist in the play console account, so make sure you upload a manual apk or aab first through the console - # https://github.com/r0adkll/upload-google-play/tree/v1/ - packageName: com.thebest.gamchha - releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} - track: internal - inAppUpdatePriority: 3 - status: draft - # userFraction: 0.5 - whatsNewDirectory: android/release-notes/ - releaseName: v1.0.4 + # - name: Upload Artifact + # uses: actions/upload-artifact@v3 + # with: + # name: Signed App Bundle + # path: ${{steps.sign_app.outputs.signedReleaseFile}} + + # - name: Deploy to Play Store (Internal testing) + # uses: r0adkll/upload-google-play@v1 + # with: + # serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} + # # The packageName must already exist in the play console account, so make sure you upload a manual apk or aab first through the console + # # https://github.com/r0adkll/upload-google-play/tree/v1/ + # packageName: com.thebest.gamchha + # releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} + # track: internal + # inAppUpdatePriority: 3 + # status: draft + # # userFraction: 0.5 + # whatsNewDirectory: android/release-notes/ + # releaseName: v1.0.4 From fa0695bac4cb048fb5073da7d17e7b4e8db1345a Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 17:23:04 +0600 Subject: [PATCH 45/84] feat: change Gamchha text colour to blue --- App.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/App.tsx b/App.tsx index 43e0d12..e83882e 100644 --- a/App.tsx +++ b/App.tsx @@ -56,7 +56,8 @@ function App(): JSX.Element { ); } -const RED_COLOR = 'red'; +// const RED_COLOR = 'red'; +const BLUE_COLOR = 'blue'; const styles = StyleSheet.create({ sectionHeader: { padding: 85, @@ -69,7 +70,7 @@ const styles = StyleSheet.create({ highlight: { fontSize: 24, fontWeight: '700', - color: RED_COLOR, + color: BLUE_COLOR, }, }); From 2ed323684d6ba65bee38028e1b51feb86a10e1ca Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 17:33:35 +0600 Subject: [PATCH 46/84] feat: change Gamchha text colour to red --- App.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/App.tsx b/App.tsx index e83882e..78846af 100644 --- a/App.tsx +++ b/App.tsx @@ -56,8 +56,8 @@ function App(): JSX.Element { ); } -// const RED_COLOR = 'red'; -const BLUE_COLOR = 'blue'; +const RED_COLOR = 'red'; +// const BLUE_COLOR = 'blue'; const styles = StyleSheet.create({ sectionHeader: { padding: 85, @@ -70,7 +70,7 @@ const styles = StyleSheet.create({ highlight: { fontSize: 24, fontWeight: '700', - color: BLUE_COLOR, + color: RED_COLOR, }, }); From 31860af25624077756951f0f70e5a421e485e89c Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 17:52:10 +0600 Subject: [PATCH 47/84] feat: change Gamchha text colour to blue --- .github/workflows/ci-cd-develop.yml | 44 ++++++++++++++--------------- App.tsx | 6 ++-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index fc84be9..3bf62a5 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -159,41 +159,41 @@ jobs: - name: Make Gradlew Executable run: cd android && chmod +x ./gradlew - # - name: Generate App APK + - name: Generate App APK + run: | + cd android && ./gradlew assembleRelease --no-daemon + + - name: Sign generated APK + id: sign_app + uses: r0adkll/sign-android-release@v1 + with: + releaseDirectory: android/app/build/outputs/apk/release + signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} + alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} + keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + + # - name: Check app directory after signing (debug) # run: | - # cd android && ./gradlew assembleRelease --no-daemon + # ls -a android/app/build/outputs/apk/release + + # - name: Build Android App Bundle + # run: cd android && ./gradlew bundleRelease --no-daemon - # - name: Sign generated APK + # - name: Sign App Bundle # id: sign_app # uses: r0adkll/sign-android-release@v1 # with: - # releaseDirectory: android/app/build/outputs/apk/release + # releaseDirectory: android/app/build/outputs/bundle/release # signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} # alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} # keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} # keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - # - name: Check app directory after signing (debug) - # run: | - # ls -a android/app/build/outputs/apk/release - - - name: Build Android App Bundle - run: cd android && ./gradlew bundleRelease --no-daemon - - - name: Sign App Bundle - id: sign_app - uses: r0adkll/sign-android-release@v1 - with: - releaseDirectory: android/app/build/outputs/bundle/release - signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} - alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} - keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - ## Distribute app to Firebase App Distribution for testing ## Use google play internal track if you have a google play account ## (uncomment the sections below if you want to use Play Store) - - name: upload artifact to Firebase App Distribution + - name: Upload artifact to Firebase App Distribution uses: wzieba/Firebase-Distribution-Github-Action@v1 with: appId: ${{secrets.ANDROID_FIREBASE_APP_ID}} diff --git a/App.tsx b/App.tsx index 78846af..e83882e 100644 --- a/App.tsx +++ b/App.tsx @@ -56,8 +56,8 @@ function App(): JSX.Element { ); } -const RED_COLOR = 'red'; -// const BLUE_COLOR = 'blue'; +// const RED_COLOR = 'red'; +const BLUE_COLOR = 'blue'; const styles = StyleSheet.create({ sectionHeader: { padding: 85, @@ -70,7 +70,7 @@ const styles = StyleSheet.create({ highlight: { fontSize: 24, fontWeight: '700', - color: RED_COLOR, + color: BLUE_COLOR, }, }); From d6472dd1d75f32dfb42d885b6a7a785262b68854 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 20:13:15 +0600 Subject: [PATCH 48/84] devops: change internal deployment back to play store --- .github/workflows/ci-cd-develop.yml | 96 ++++++++++++++--------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 3bf62a5..9aece86 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -159,65 +159,65 @@ jobs: - name: Make Gradlew Executable run: cd android && chmod +x ./gradlew - - name: Generate App APK - run: | - cd android && ./gradlew assembleRelease --no-daemon - - - name: Sign generated APK - id: sign_app - uses: r0adkll/sign-android-release@v1 - with: - releaseDirectory: android/app/build/outputs/apk/release - signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} - alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} - keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - # - name: Check app directory after signing (debug) + # - name: Generate App APK # run: | - # ls -a android/app/build/outputs/apk/release - - # - name: Build Android App Bundle - # run: cd android && ./gradlew bundleRelease --no-daemon + # cd android && ./gradlew assembleRelease --no-daemon - # - name: Sign App Bundle + # - name: Sign generated APK # id: sign_app # uses: r0adkll/sign-android-release@v1 # with: - # releaseDirectory: android/app/build/outputs/bundle/release + # releaseDirectory: android/app/build/outputs/apk/release # signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} # alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} # keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} # keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - ## Distribute app to Firebase App Distribution for testing - ## Use google play internal track if you have a google play account - ## (uncomment the sections below if you want to use Play Store) - - name: Upload artifact to Firebase App Distribution - uses: wzieba/Firebase-Distribution-Github-Action@v1 + # - name: Check app directory after signing (debug) + # run: | + # ls -a android/app/build/outputs/apk/release + + - name: Build Android App Bundle + run: cd android && ./gradlew bundleRelease --no-daemon + + - name: Sign App Bundle + id: sign_app + uses: r0adkll/sign-android-release@v1 with: - appId: ${{secrets.ANDROID_FIREBASE_APP_ID}} - token: ${{secrets.ANDROID_FIREBASE_TOKEN}} - groups: testers - file: ${{steps.sign_app.outputs.signedReleaseFile}} + releaseDirectory: android/app/build/outputs/bundle/release + signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} + alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} + keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - # - name: Upload Artifact - # uses: actions/upload-artifact@v3 + # ## Distribute app to Firebase App Distribution for testing + # ## Use google play internal track if you have a google play account + # ## (uncomment the sections below if you want to use Play Store) + # - name: Upload artifact to Firebase App Distribution + # uses: wzieba/Firebase-Distribution-Github-Action@v1 # with: - # name: Signed App Bundle - # path: ${{steps.sign_app.outputs.signedReleaseFile}} + # appId: ${{secrets.ANDROID_FIREBASE_APP_ID}} + # token: ${{secrets.ANDROID_FIREBASE_TOKEN}} + # groups: testers + # file: ${{steps.sign_app.outputs.signedReleaseFile}} - # - name: Deploy to Play Store (Internal testing) - # uses: r0adkll/upload-google-play@v1 - # with: - # serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} - # # The packageName must already exist in the play console account, so make sure you upload a manual apk or aab first through the console - # # https://github.com/r0adkll/upload-google-play/tree/v1/ - # packageName: com.thebest.gamchha - # releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} - # track: internal - # inAppUpdatePriority: 3 - # status: draft - # # userFraction: 0.5 - # whatsNewDirectory: android/release-notes/ - # releaseName: v1.0.4 + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: Signed App Bundle + path: ${{steps.sign_app.outputs.signedReleaseFile}} + + - name: Deploy to Play Store (Internal testing) + uses: r0adkll/upload-google-play@v1 + with: + serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} + # The packageName must already exist in the play console account, so make sure you upload a manual apk or aab first through the console + # https://github.com/r0adkll/upload-google-play/tree/v1/ + packageName: com.thebest.gamchha + releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} + track: internal + inAppUpdatePriority: 3 + status: draft + # userFraction: 0.5 + whatsNewDirectory: android/release-notes/ + releaseName: v1.0.4 From 616f7aa1fca73100cf836b71af22e3c1a9908bd7 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 21:15:57 +0600 Subject: [PATCH 49/84] docs: added staging ci/cd badge --- .github/workflows/alpha-cd.txt | 149 --------------------------------- README.md | 1 + 2 files changed, 1 insertion(+), 149 deletions(-) delete mode 100644 .github/workflows/alpha-cd.txt diff --git a/.github/workflows/alpha-cd.txt b/.github/workflows/alpha-cd.txt deleted file mode 100644 index 050cfcc..0000000 --- a/.github/workflows/alpha-cd.txt +++ /dev/null @@ -1,149 +0,0 @@ -name: Alpha Deployment - -on: - push: - branches: - - alpha - -jobs: - dev-distribution: - runs-on: ubuntu-latest - - name: Development Distribution - env: - MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_ALIAS }} - MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - steps: - - name: Checkout branch - uses: actions/checkout@v3 - - # Cache npm dependencies (from GitHub docs) - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - # If there's a cache miss - - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: npm list - # Caching process complete - - - name: Install node dependencies - run: npm install - - - name: Lint check - run: npm run lint - - - name: Run tests - run: npm run test - - # - name: Read Version - # id: read-version - # run: | - # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" - # echo "::set-output name=versionName::$(jq -r '.versionName' version.json)" - - # # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" - # # echo "::set-output name=versionName::$(node -p -e "require('./version.json').versionName")" - - # - name: Increment Version - # id: increment-version - # run: | - # echo "::set-output name=versionCode::$(node -p \"parseInt('${{ steps.read-version.outputs.versionCode }}') + 1\")" - # echo "::set-output name=versionName::$(node -p \"'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))\")" - - # # echo "::set-output name=versionCode::$(node -p -e 'parseInt(${ steps.read-version.outputs.versionCode }) + 1')" - # # echo "::set-output name=versionName::$(node -p -e "'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))")" - - # - name: Update build.gradle - # run: | - # sed -i "s/versionCode .*/versionCode ${{ steps.increment-version.outputs.versionCode }}/" android/app/build.gradle - # sed -i "s/versionName .*/versionName '${{ steps.increment-version.outputs.versionName }}'/" android/app/build.gradle - - # - name: Commit and Push Changes - # uses: stefanzweifel/git-auto-commit-action@v4 - # with: - # commit_message: devops - update versionCode and versionName [skip ci] - - - name: Cache Gradle Wrapper - uses: actions/cache@v3 - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - - - name: Cache Gradle Dependencies - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - restore-keys: ${{ runner.os }}-gradle-caches- - - # Start the build process - - name: Make Gradlew Executable - run: | - cd android && chmod +x ./gradlew - - # - name: Generate App APK - # run: | - # cd android && ./gradlew assembleRelease --no-daemon - - # - name: Sign generated APK - # id: sign_app - # uses: r0adkll/sign-android-release@v1 - # with: - # releaseDirectory: android/app/build/outputs/apk/release - # signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} - # alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} - # keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - # keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - # - name: Check app directory after signing (debug) - # run: | - # ls -a android/app/build/outputs/apk/release - - - name: Build Android App Bundle - run: cd android && ./gradlew bundleRelease --no-daemon - - - name: Sign App Bundle - id: sign_app - uses: r0adkll/sign-android-release@v1 - with: - releaseDirectory: android/app/build/outputs/bundle/release - signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} - alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} - keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: Signed App Bundle - path: ${{steps.sign_app.outputs.signedReleaseFile}} - - - name: Deploy to Play Store (Internal testing) - uses: r0adkll/upload-google-play@v1 - with: - serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} - # The packageName must already exist in the play console account, so make sure you upload a manual apk or aab first through the console - # https://github.com/r0adkll/upload-google-play/tree/v1/ - packageName: com.thebest.gamchha - releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} - track: internal - inAppUpdatePriority: 3 - status: draft - # userFraction: 0.5 - whatsNewDirectory: android/release-notes/ - releaseName: v1.0.4 diff --git a/README.md b/README.md index 2ae0abd..4ec7849 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Dev CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml) +[![Staging CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml) This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). From 72ccc4877ca9c578dff558cbe1e7954ead116f7c Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 21:22:21 +0600 Subject: [PATCH 50/84] docs: removed introductory line --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 4ec7849..494bfc4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ [![Dev CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml) [![Staging CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml) -This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). - # Getting Started > **Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding. From 1d461fa62c95ed167a608f0e8fd72fed1db80248 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 21:24:09 +0600 Subject: [PATCH 51/84] debug: add debug --- .github/workflows/ci-cd-develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 9aece86..3ab45cb 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -23,6 +23,7 @@ jobs: run: | # Get the list of changed files between the base and head branches CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) + echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt)).*$ ]]; then echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." From 743f268efdebaa40d46e5dd87eb9478b38ce348a Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 21:25:07 +0600 Subject: [PATCH 52/84] docs: added back introductory line --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 494bfc4..4ec7849 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ [![Dev CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml) [![Staging CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml) +This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). + # Getting Started > **Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding. From d1bba6bfd279ae424a631e8bfff6239af781b4b0 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 22:19:19 +0600 Subject: [PATCH 53/84] devops: prevent develop ci/cd from getting triggered on PRs --- .github/workflows/ci-cd-develop.yml | 5 +++++ .github/workflows/staging-cd.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 3ab45cb..9c1c3b9 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -4,6 +4,11 @@ on: push: branches: - develop + pull_request: + # Prevent triggering this workflow for PRs + branches-ignore: + - staging + - main jobs: # Don't run CI/CD if only README.md and/or any .yml file is updated diff --git a/.github/workflows/staging-cd.yml b/.github/workflows/staging-cd.yml index 7bddadc..a866cb2 100644 --- a/.github/workflows/staging-cd.yml +++ b/.github/workflows/staging-cd.yml @@ -216,7 +216,7 @@ jobs: packageName: com.thebest.gamchha releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} track: alpha + status: draft inAppUpdatePriority: 3 - userFraction: 0.5 whatsNewDirectory: android/release-notes/ releaseName: v1.0.0.a From f90bfa395595b4b84fe87f45803361a7ea539b7a Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 22:21:17 +0600 Subject: [PATCH 54/84] devops: prevent staging ci/cd from getting triggered on code push --- .github/workflows/staging-cd.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/staging-cd.yml b/.github/workflows/staging-cd.yml index a866cb2..a414345 100644 --- a/.github/workflows/staging-cd.yml +++ b/.github/workflows/staging-cd.yml @@ -4,6 +4,10 @@ on: pull_request: branches: - staging + push: + branches: + - develop + - main jobs: # Don't run CI/CD if only README.md and/or any .yml file is updated From 31dc01ac62a18f82172e205e06594ca5797b99e0 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 22:22:13 +0600 Subject: [PATCH 55/84] devops: prevent staging ci/cd from getting triggered on code push --- .github/workflows/staging-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/staging-cd.yml b/.github/workflows/staging-cd.yml index a414345..c2218f9 100644 --- a/.github/workflows/staging-cd.yml +++ b/.github/workflows/staging-cd.yml @@ -5,7 +5,7 @@ on: branches: - staging push: - branches: + branches-ignore: - develop - main From 2322adf8a4c2a2dcf6d3a64f464e4548eb3fadb3 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 22:26:51 +0600 Subject: [PATCH 56/84] devops: trigger only one ci/cd workflow for a single event --- .github/workflows/ci-cd-develop.yml | 1 + .github/workflows/staging-cd.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 9c1c3b9..b24bfc8 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -7,6 +7,7 @@ on: pull_request: # Prevent triggering this workflow for PRs branches-ignore: + - develop - staging - main diff --git a/.github/workflows/staging-cd.yml b/.github/workflows/staging-cd.yml index c2218f9..293beb3 100644 --- a/.github/workflows/staging-cd.yml +++ b/.github/workflows/staging-cd.yml @@ -7,6 +7,7 @@ on: push: branches-ignore: - develop + - staging - main jobs: From 616e9ff617d843a208e6a0c632fd13a0a1c6e6a5 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Wed, 26 Jul 2023 22:30:02 +0600 Subject: [PATCH 57/84] devops: trigger only one ci/cd workflow for a single event --- .github/workflows/staging-cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/staging-cd.yml b/.github/workflows/staging-cd.yml index 293beb3..acbeb74 100644 --- a/.github/workflows/staging-cd.yml +++ b/.github/workflows/staging-cd.yml @@ -6,6 +6,7 @@ on: - staging push: branches-ignore: + # Prevent triggering this workflow for any code push - develop - staging - main From 34f94914f636a7ddb494ed7e4411d360bd919100 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 19:20:24 +0600 Subject: [PATCH 58/84] deleted staging workflow --- .github/workflows/staging-cd.yml | 228 ------------------------------- 1 file changed, 228 deletions(-) delete mode 100644 .github/workflows/staging-cd.yml diff --git a/.github/workflows/staging-cd.yml b/.github/workflows/staging-cd.yml deleted file mode 100644 index acbeb74..0000000 --- a/.github/workflows/staging-cd.yml +++ /dev/null @@ -1,228 +0,0 @@ -name: Staging CI/CD - -on: - pull_request: - branches: - - staging - push: - branches-ignore: - # Prevent triggering this workflow for any code push - - develop - - staging - - main - -jobs: - # Don't run CI/CD if only README.md and/or any .yml file is updated - check_readme_yml_txt_changes: - runs-on: ubuntu-latest - outputs: - run_rest_jobs: ${{ steps.set_output.outputs.run_jobs }} - - steps: - - name: Checkout branch - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Check for README, yml or txt changes - id: set_output - run: | - # Get the list of changed files between the base and head branches - CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) - # Check if 'README.md' or '.yml' files are the only files changed - if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt)).*$ ]]; then - echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." - # GITHUB_OUTPUT is a default GitHub env. variable - echo "run_jobs=false" >> ${GITHUB_OUTPUT} - else - echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." - echo "run_jobs=true" >> ${GITHUB_OUTPUT} - fi - - test: - needs: check_readme_yml_txt_changes - if: needs.check_readme_yml_txt_changes.outputs.run_rest_jobs == 'true' - runs-on: ubuntu-latest - - steps: - - name: Checkout branch - uses: actions/checkout@v3 - - # Cache npm dependencies (from GitHub docs) - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - # If there's a cache miss - - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: npm list - # Caching process complete - - - name: Install dependencies - run: npm install - - - name: Lint check - run: npm run lint - - - name: Run tests - run: npm run test - - deploy: - needs: test - # default action is success(): if(success) - runs-on: ubuntu-latest - env: - MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_ALIAS }} - MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - steps: - # We need to checkout the current branch and install node - # dependencies again because every GH Actions job runs on - # a seperate runner (VM) - - name: Checkout branch - uses: actions/checkout@v3 - - # Cache npm dependencies (from GitHub docs) - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - # If there's a cache miss - - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: npm list - # Caching process complete - - - name: Install dependencies - run: npm install - - # - name: Read Version - # id: read-version - # run: | - # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" - # echo "::set-output name=versionName::$(jq -r '.versionName' version.json)" - - # # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" - # # echo "::set-output name=versionName::$(node -p -e "require('./version.json').versionName")" - - # - name: Increment Version - # id: increment-version - # run: | - # echo "::set-output name=versionCode::$(node -p \"parseInt('${{ steps.read-version.outputs.versionCode }}') + 1\")" - # echo "::set-output name=versionName::$(node -p \"'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))\")" - - # # echo "::set-output name=versionCode::$(node -p -e 'parseInt(${ steps.read-version.outputs.versionCode }) + 1')" - # # echo "::set-output name=versionName::$(node -p -e "'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))")" - - # - name: Update build.gradle - # run: | - # sed -i "s/versionCode .*/versionCode ${{ steps.increment-version.outputs.versionCode }}/" android/app/build.gradle - # sed -i "s/versionName .*/versionName '${{ steps.increment-version.outputs.versionName }}'/" android/app/build.gradle - - # - name: Commit and Push Changes - # uses: stefanzweifel/git-auto-commit-action@v4 - # with: - # commit_message: devops - update versionCode and versionName [skip ci] - - - name: Cache Gradle Wrapper - uses: actions/cache@v3 - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - - - name: Cache Gradle Dependencies - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - restore-keys: ${{ runner.os }}-gradle-caches- - - # Start the build process - - name: Make Gradlew Executable - run: cd android && chmod +x ./gradlew - - # - name: Generate App APK - # run: | - # cd android && ./gradlew assembleRelease --no-daemon - - # - name: Sign generated APK - # id: sign_app - # uses: r0adkll/sign-android-release@v1 - # with: - # releaseDirectory: android/app/build/outputs/apk/release - # signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} - # alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} - # keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - # keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - # - name: Check app directory after signing (debug) - # run: | - # ls -a android/app/build/outputs/apk/release - - - name: Build Android App Bundle - run: cd android && ./gradlew bundleRelease --no-daemon - - - name: Sign App Bundle - id: sign_app - uses: r0adkll/sign-android-release@v1 - with: - releaseDirectory: android/app/build/outputs/bundle/release - signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} - alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} - keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} - keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - - # ## Distribute app to Firebase App Distribution for testing - # ## Use google play internal track if you have a google play account - # ## (uncomment the sections below if you want to use Play Store) - # - name: Upload artifact to Firebase App Distribution - # uses: wzieba/Firebase-Distribution-Github-Action@v1 - # with: - # appId: ${{secrets.ANDROID_FIREBASE_APP_ID}} - # token: ${{secrets.ANDROID_FIREBASE_TOKEN}} - # groups: testers - # file: ${{steps.sign_app.outputs.signedReleaseFile}} - - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: Signed App Bundle - path: ${{steps.sign_app.outputs.signedReleaseFile}} - - - name: Deploy to Play Store (Alpha) - uses: r0adkll/upload-google-play@v1 - with: - serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} - # The packageName must already exist in the play console account, so make sure you upload a manual apk or aab first through the console - # https://github.com/r0adkll/upload-google-play/tree/v1/ - packageName: com.thebest.gamchha - releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} - track: alpha - status: draft - inAppUpdatePriority: 3 - whatsNewDirectory: android/release-notes/ - releaseName: v1.0.0.a From 8f72b6e87a9e00626a39f9dbb3db5b7cd88c30b6 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 19:24:55 +0600 Subject: [PATCH 59/84] docs: removed deve ci-cd badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 4ec7849..c189908 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![Dev CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml) [![Staging CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml) This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). From eaff12f0509e6f5b49c81666510d029110b9e6f8 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 19:26:46 +0600 Subject: [PATCH 60/84] docs: removed staging ci/cd badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c189908..2ae0abd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Staging CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml) +[![Dev CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml) This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). From f72ef5eb4087582a0d8fd3a3cb18ff7bd995141d Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 19:56:25 +0600 Subject: [PATCH 61/84] devops: removed pull request branches-ignore --- .github/workflows/ci-cd-develop.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index b24bfc8..3ab45cb 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -4,12 +4,6 @@ on: push: branches: - develop - pull_request: - # Prevent triggering this workflow for PRs - branches-ignore: - - develop - - staging - - main jobs: # Don't run CI/CD if only README.md and/or any .yml file is updated From f87902a7ca96529574e847ecc46c222c0269fa6a Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 20:13:37 +0600 Subject: [PATCH 62/84] chores: added git hooks to prevent yml and README.md files from merging --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7ce3b84 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +.github/workflows/*.yml merge=ours +README.md merge=ours From b819a07546ed5d0a0273d6f8ac703e5bc6e0fb5c Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 20:19:14 +0600 Subject: [PATCH 63/84] devops: ignore gitattributes and gitignore files while running ci/cd workflows --- .gitattributes | 2 +- .github/workflows/ci-cd-develop.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 7ce3b84..d593d0e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -.github/workflows/*.yml merge=ours README.md merge=ours +.github/workflows/*.yml merge=ours diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 3ab45cb..b3f6c33 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -25,7 +25,7 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed - if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt)).*$ ]]; then + if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore)).*$ ]]; then echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." # GITHUB_OUTPUT is a default GitHub env. variable echo "run_jobs=false" >> ${GITHUB_OUTPUT} From 0e34891519543d83c0965b150e97318d0f728f71 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 21:50:04 +0600 Subject: [PATCH 64/84] feat: changed colour to red --- App.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/App.tsx b/App.tsx index e83882e..4828632 100644 --- a/App.tsx +++ b/App.tsx @@ -56,8 +56,8 @@ function App(): JSX.Element { ); } -// const RED_COLOR = 'red'; -const BLUE_COLOR = 'blue'; +const RED_COLOR = 'red'; +// const BLUE_COLOR = 'blue'; const styles = StyleSheet.create({ sectionHeader: { padding: 85, @@ -70,7 +70,8 @@ const styles = StyleSheet.create({ highlight: { fontSize: 24, fontWeight: '700', - color: BLUE_COLOR, + // color: BLUE_COLOR, + color: RED_COLOR, }, }); From 9e9015c8f3398289aed9e2e9f4bb8bb841ef81af Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 21:53:20 +0600 Subject: [PATCH 65/84] chores: added build.grade to gitattributes --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitattributes b/.gitattributes index d593d0e..696e1a6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,4 @@ README.md merge=ours .github/workflows/*.yml merge=ours +android/build.gradle merge=ours +android/app/build.gradle merge=ours From c7fb562517651b7ed63179baf58aead0dbb72dc6 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 22:01:53 +0600 Subject: [PATCH 66/84] chores: added build.gradle to gitattributes --- .github/workflows/ci-cd-develop.yml | 2 +- android/app/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index b3f6c33..0429042 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -25,7 +25,7 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed - if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore)).*$ ]]; then + if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|build\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|build\.gradle)).*$ ]]; then echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." # GITHUB_OUTPUT is a default GitHub env. variable echo "run_jobs=false" >> ${GITHUB_OUTPUT} diff --git a/android/app/build.gradle b/android/app/build.gradle index 2d7ceb1..7043308 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -92,7 +92,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 5 - versionName "1.0.0.a" + versionName "1.0.4" } signingConfigs { debug { From b1b41536d92cf21b3d89d8cf425985daa4885421 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 22:22:01 +0600 Subject: [PATCH 67/84] fix: updated .gradle pattern --- .github/workflows/ci-cd-develop.yml | 2 +- android/app/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 0429042..e441a06 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -25,7 +25,7 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) echo ${CHANGED_FILES} # Check if 'README.md' or '.yml' files are the only files changed - if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|build\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|build\.gradle)).*$ ]]; then + if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)).*$ ]]; then echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." # GITHUB_OUTPUT is a default GitHub env. variable echo "run_jobs=false" >> ${GITHUB_OUTPUT} diff --git a/android/app/build.gradle b/android/app/build.gradle index 7043308..afb7b59 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -92,7 +92,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 5 - versionName "1.0.4" + versionName "1.0.4.0" } signingConfigs { debug { From f00a8aabda2ddf6bab487067238ea16bd28fc569 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 23:10:27 +0600 Subject: [PATCH 68/84] feat: colour updated to blue --- App.tsx | 8 ++++---- android/app/build.gradle | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/App.tsx b/App.tsx index 4828632..e3700f4 100644 --- a/App.tsx +++ b/App.tsx @@ -56,8 +56,8 @@ function App(): JSX.Element { ); } -const RED_COLOR = 'red'; -// const BLUE_COLOR = 'blue'; +// const RED_COLOR = 'red'; +const BLUE_COLOR = 'blue'; const styles = StyleSheet.create({ sectionHeader: { padding: 85, @@ -70,8 +70,8 @@ const styles = StyleSheet.create({ highlight: { fontSize: 24, fontWeight: '700', - // color: BLUE_COLOR, - color: RED_COLOR, + color: BLUE_COLOR, + // color: RED_COLOR, }, }); diff --git a/android/app/build.gradle b/android/app/build.gradle index afb7b59..7043308 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -92,7 +92,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 5 - versionName "1.0.4.0" + versionName "1.0.4" } signingConfigs { debug { From 553dded3b0e1f3a35db48b837c7d9522db9fc9f1 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 23:31:58 +0600 Subject: [PATCH 69/84] feat: colour updated to red --- .github/workflows/ci-cd-develop.yml | 30 ++++++++++++++++++++++------- App.tsx | 8 ++++---- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index e441a06..130001a 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -24,16 +24,32 @@ jobs: # Get the list of changed files between the base and head branches CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) echo ${CHANGED_FILES} - # Check if 'README.md' or '.yml' files are the only files changed - if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)).*$ ]]; then - echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." - # GITHUB_OUTPUT is a default GitHub env. variable - echo "run_jobs=false" >> ${GITHUB_OUTPUT} - else - echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." + + # Define the regular expression pattern for allowed file types + SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$" + + # Check if there are any changed files that are not allowed + VALID_CHANGES=$(echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}") + + if [ -n "${VALID_CHANGES}" ]; then + echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." echo "run_jobs=true" >> ${GITHUB_OUTPUT} + else + echo "Only README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle files have been updated. Skipping the CI/CD workflow." + echo "run_jobs=false" >> ${GITHUB_OUTPUT} fi + + # # Check if 'README.md' or '.yml' files are the only files changed + # if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)).*$ ]]; then + # echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." + # # GITHUB_OUTPUT is a default GitHub env. variable + # echo "run_jobs=false" >> ${GITHUB_OUTPUT} + # else + # echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." + # echo "run_jobs=true" >> ${GITHUB_OUTPUT} + # fi + test: needs: check_readme_yml_txt_changes if: needs.check_readme_yml_txt_changes.outputs.run_rest_jobs == 'true' diff --git a/App.tsx b/App.tsx index e3700f4..4828632 100644 --- a/App.tsx +++ b/App.tsx @@ -56,8 +56,8 @@ function App(): JSX.Element { ); } -// const RED_COLOR = 'red'; -const BLUE_COLOR = 'blue'; +const RED_COLOR = 'red'; +// const BLUE_COLOR = 'blue'; const styles = StyleSheet.create({ sectionHeader: { padding: 85, @@ -70,8 +70,8 @@ const styles = StyleSheet.create({ highlight: { fontSize: 24, fontWeight: '700', - color: BLUE_COLOR, - // color: RED_COLOR, + // color: BLUE_COLOR, + color: RED_COLOR, }, }); From b4c1a349d0542dbb27be913b5e7e276e749b0114 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Fri, 4 Aug 2023 23:34:14 +0600 Subject: [PATCH 70/84] chores: updated app version numbers for next build --- .github/workflows/ci-cd-develop.yml | 2 +- android/app/build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 130001a..90e918b 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -237,4 +237,4 @@ jobs: status: draft # userFraction: 0.5 whatsNewDirectory: android/release-notes/ - releaseName: v1.0.4 + releaseName: v1.0.5 diff --git a/android/app/build.gradle b/android/app/build.gradle index 7043308..2956b5a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -91,8 +91,8 @@ android { applicationId "com.thebest.gamchha" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 5 - versionName "1.0.4" + versionCode 6 + versionName "1.0.5" } signingConfigs { debug { From 0c9bd2b93eb84a37c59a49c6e651711a9fe0ba08 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sat, 5 Aug 2023 18:40:23 +0600 Subject: [PATCH 71/84] fix: print out variables for debugging --- .github/workflows/ci-cd-develop.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 90e918b..8c0da68 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -27,9 +27,11 @@ jobs: # Define the regular expression pattern for allowed file types SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$" + echo ${SKIP_FILE_TYPES} # Check if there are any changed files that are not allowed VALID_CHANGES=$(echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}") + echo ${VALID_CHANGES} if [ -n "${VALID_CHANGES}" ]; then echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." From 8f901b06899403aa18bb041884c64cb2c222682c Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sat, 5 Aug 2023 20:42:48 +0600 Subject: [PATCH 72/84] fix: revert to previous logic --- .github/workflows/ci-cd-develop.yml | 44 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 8c0da68..b0b805b 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -25,33 +25,33 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) echo ${CHANGED_FILES} - # Define the regular expression pattern for allowed file types - SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$" - echo ${SKIP_FILE_TYPES} + # # Define the regular expression pattern for allowed file types + # SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$" + # echo ${SKIP_FILE_TYPES} - # Check if there are any changed files that are not allowed - VALID_CHANGES=$(echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}") - echo ${VALID_CHANGES} + # # Check if there are any changed files that are not allowed + # VALID_CHANGES=$(echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}") + # echo ${VALID_CHANGES} - if [ -n "${VALID_CHANGES}" ]; then - echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." - echo "run_jobs=true" >> ${GITHUB_OUTPUT} - else - echo "Only README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle files have been updated. Skipping the CI/CD workflow." - echo "run_jobs=false" >> ${GITHUB_OUTPUT} - fi - - - # # Check if 'README.md' or '.yml' files are the only files changed - # if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)).*$ ]]; then - # echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." - # # GITHUB_OUTPUT is a default GitHub env. variable - # echo "run_jobs=false" >> ${GITHUB_OUTPUT} - # else - # echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." + # if [ -n "${VALID_CHANGES}" ]; then + # echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." # echo "run_jobs=true" >> ${GITHUB_OUTPUT} + # else + # echo "Only README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle files have been updated. Skipping the CI/CD workflow." + # echo "run_jobs=false" >> ${GITHUB_OUTPUT} # fi + + # Check if 'README.md' or '.yml' files are the only files changed + if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)).*$ ]]; then + echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." + # GITHUB_OUTPUT is a default GitHub env. variable + echo "run_jobs=false" >> ${GITHUB_OUTPUT} + else + echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." + echo "run_jobs=true" >> ${GITHUB_OUTPUT} + fi + test: needs: check_readme_yml_txt_changes if: needs.check_readme_yml_txt_changes.outputs.run_rest_jobs == 'true' From 1c83e7ea20ae6c8084a3e5fe0114cca91461d06f Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sat, 5 Aug 2023 22:36:14 +0600 Subject: [PATCH 73/84] fix: revert to new logic --- .github/workflows/ci-cd-develop.yml | 44 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index b0b805b..8c0da68 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -25,33 +25,33 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) echo ${CHANGED_FILES} - # # Define the regular expression pattern for allowed file types - # SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$" - # echo ${SKIP_FILE_TYPES} + # Define the regular expression pattern for allowed file types + SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$" + echo ${SKIP_FILE_TYPES} - # # Check if there are any changed files that are not allowed - # VALID_CHANGES=$(echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}") - # echo ${VALID_CHANGES} + # Check if there are any changed files that are not allowed + VALID_CHANGES=$(echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}") + echo ${VALID_CHANGES} - # if [ -n "${VALID_CHANGES}" ]; then - # echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." - # echo "run_jobs=true" >> ${GITHUB_OUTPUT} - # else - # echo "Only README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle files have been updated. Skipping the CI/CD workflow." - # echo "run_jobs=false" >> ${GITHUB_OUTPUT} - # fi - - - # Check if 'README.md' or '.yml' files are the only files changed - if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)).*$ ]]; then - echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." - # GITHUB_OUTPUT is a default GitHub env. variable - echo "run_jobs=false" >> ${GITHUB_OUTPUT} - else - echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." + if [ -n "${VALID_CHANGES}" ]; then + echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." echo "run_jobs=true" >> ${GITHUB_OUTPUT} + else + echo "Only README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle files have been updated. Skipping the CI/CD workflow." + echo "run_jobs=false" >> ${GITHUB_OUTPUT} fi + + # # Check if 'README.md' or '.yml' files are the only files changed + # if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)).*$ ]]; then + # echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." + # # GITHUB_OUTPUT is a default GitHub env. variable + # echo "run_jobs=false" >> ${GITHUB_OUTPUT} + # else + # echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." + # echo "run_jobs=true" >> ${GITHUB_OUTPUT} + # fi + test: needs: check_readme_yml_txt_changes if: needs.check_readme_yml_txt_changes.outputs.run_rest_jobs == 'true' From c0c4671d5aae15e5cf276b58402308d227b5b280 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sat, 5 Aug 2023 22:38:04 +0600 Subject: [PATCH 74/84] fix: add more printouts to new logic --- .github/workflows/ci-cd-develop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 8c0da68..eb34850 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -30,8 +30,11 @@ jobs: echo ${SKIP_FILE_TYPES} # Check if there are any changed files that are not allowed + echo "Entering VALID_CHANGES" VALID_CHANGES=$(echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}") + echo "Exiting VALID_CHANGES" echo ${VALID_CHANGES} + echo "Exited VALID_CHANGES" if [ -n "${VALID_CHANGES}" ]; then echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." From eb0beb86cc9b4138b43f5e4de7f2227b18e5ea79 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sat, 5 Aug 2023 23:06:58 +0600 Subject: [PATCH 75/84] fix: replace parenthesis with backticks --- .github/workflows/ci-cd-develop.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index eb34850..2e077a1 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -30,11 +30,8 @@ jobs: echo ${SKIP_FILE_TYPES} # Check if there are any changed files that are not allowed - echo "Entering VALID_CHANGES" - VALID_CHANGES=$(echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}") - echo "Exiting VALID_CHANGES" + VALID_CHANGES=`echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}"` echo ${VALID_CHANGES} - echo "Exited VALID_CHANGES" if [ -n "${VALID_CHANGES}" ]; then echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." From 4334e6fcaaccd9ec365b35074fdcf8832849847b Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sat, 5 Aug 2023 23:31:38 +0600 Subject: [PATCH 76/84] fix: refactored skip file pattern --- .github/workflows/ci-cd-develop.yml | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 2e077a1..d98512e 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -29,29 +29,29 @@ jobs: SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$" echo ${SKIP_FILE_TYPES} - # Check if there are any changed files that are not allowed - VALID_CHANGES=`echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}"` - echo ${VALID_CHANGES} + # # Check if there are any changed files that are not allowed + # VALID_CHANGES=`echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}"` + # echo ${VALID_CHANGES} - if [ -n "${VALID_CHANGES}" ]; then - echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." - echo "run_jobs=true" >> ${GITHUB_OUTPUT} - else - echo "Only README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle files have been updated. Skipping the CI/CD workflow." - echo "run_jobs=false" >> ${GITHUB_OUTPUT} - fi - - - # # Check if 'README.md' or '.yml' files are the only files changed - # if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)).*$ ]]; then - # echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." - # # GITHUB_OUTPUT is a default GitHub env. variable - # echo "run_jobs=false" >> ${GITHUB_OUTPUT} - # else - # echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." + # if [ -n "${VALID_CHANGES}" ]; then + # echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." # echo "run_jobs=true" >> ${GITHUB_OUTPUT} + # else + # echo "Only README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle files have been updated. Skipping the CI/CD workflow." + # echo "run_jobs=false" >> ${GITHUB_OUTPUT} # fi + + # Check if 'README.md' or '.yml' files are the only files changed + if [[ ${CHANGED_FILES} =~ ${SKIP_FILE_TYPES} && ! ${CHANGED_FILES} =~ ^(?!.*${SKIP_FILE_TYPES}).*$ ]]; then + echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." + # GITHUB_OUTPUT is a default GitHub env. variable + echo "run_jobs=false" >> ${GITHUB_OUTPUT} + else + echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." + echo "run_jobs=true" >> ${GITHUB_OUTPUT} + fi + test: needs: check_readme_yml_txt_changes if: needs.check_readme_yml_txt_changes.outputs.run_rest_jobs == 'true' From 0d0079738cb8528ed9daad1eb3a10c6d8ca03afb Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sat, 5 Aug 2023 23:35:13 +0600 Subject: [PATCH 77/84] docs: updated readme --- .github/workflows/ci-cd-develop.yml | 17 +----- README.md | 82 +---------------------------- 2 files changed, 3 insertions(+), 96 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index d98512e..32d9308 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -23,24 +23,11 @@ jobs: run: | # Get the list of changed files between the base and head branches CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) - echo ${CHANGED_FILES} + echo "CHANGED_FILES = ${CHANGED_FILES}" # Define the regular expression pattern for allowed file types SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$" - echo ${SKIP_FILE_TYPES} - - # # Check if there are any changed files that are not allowed - # VALID_CHANGES=`echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}"` - # echo ${VALID_CHANGES} - - # if [ -n "${VALID_CHANGES}" ]; then - # echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow." - # echo "run_jobs=true" >> ${GITHUB_OUTPUT} - # else - # echo "Only README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle files have been updated. Skipping the CI/CD workflow." - # echo "run_jobs=false" >> ${GITHUB_OUTPUT} - # fi - + echo "SKIP_FILE_TYPES = ${SKIP_FILE_TYPES}" # Check if 'README.md' or '.yml' files are the only files changed if [[ ${CHANGED_FILES} =~ ${SKIP_FILE_TYPES} && ! ${CHANGED_FILES} =~ ^(?!.*${SKIP_FILE_TYPES}).*$ ]]; then diff --git a/README.md b/README.md index 2ae0abd..6646bdb 100644 --- a/README.md +++ b/README.md @@ -1,83 +1,3 @@ [![Dev CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml) -This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). - -# Getting Started - -> **Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding. - -## Step 1: Start the Metro Server - -First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native. - -To start Metro, run the following command from the _root_ of your React Native project: - -```bash -# using npm -npm start - -# OR using Yarn -yarn start -``` - -## Step 2: Start your Application - -Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app: - -### For Android - -```bash -# using npm -npm run android - -# OR using Yarn -yarn android -``` - -### For iOS - -```bash -# using npm -npm run ios - -# OR using Yarn -yarn ios -``` - -If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly. - -This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively. - -## Step 3: Modifying your App - -Now that you have successfully run the app, let's modify it. - -1. Open `App.tsx` in your text editor of choice and edit some lines. -2. For **Android**: Press the R key twice or select **"Reload"** from the **Developer Menu** (Ctrl + M (on Window and Linux) or Cmd ⌘ + M (on macOS)) to see your changes! - - For **iOS**: Hit Cmd ⌘ + R in your iOS Simulator to reload the app and see your changes! - -## Congratulations! :tada: - -You've successfully run and modified your React Native App. :partying_face: - -### Now what? - -- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps). -- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started). - -# Troubleshooting - -If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page. - -# Learn More - -To learn more about React Native, take a look at the following resources: - -- [React Native Website](https://reactnative.dev) - learn more about React Native. -- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment. -- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**. -- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts. -- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native. - -# Gamchha +# The Gamchha App From 591f7a5c1e492de589372f1f635913ba71193fe5 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 6 Aug 2023 03:26:02 +0600 Subject: [PATCH 78/84] fix: updated file pattern match to account for multiple file changes --- .github/workflows/ci-cd-develop.yml | 21 ++++++++++++++++++--- README.md | 2 ++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index 32d9308..deee015 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -29,9 +29,24 @@ jobs: SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$" echo "SKIP_FILE_TYPES = ${SKIP_FILE_TYPES}" - # Check if 'README.md' or '.yml' files are the only files changed - if [[ ${CHANGED_FILES} =~ ${SKIP_FILE_TYPES} && ! ${CHANGED_FILES} =~ ^(?!.*${SKIP_FILE_TYPES}).*$ ]]; then - echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow." + # Split the CHANGED_FILES into an array + # IFS -> Internal Field Separator + IFS=' ' read -ra FILE_ARRAY <<< "${CHANGED_FILES}" + + # Initialize a flag to check if any file matches the pattern + MATCH_FOUND=true + + # Check if any file in the array matches the SKIP_FILE_TYPES pattern + for file in "${FILE_ARRAY[@]}"; do + if [[ ! ${file} =~ ${SKIP_FILE_TYPES} ]]; then + MATCH_FOUND=false + break + fi + done + + # Check the MATCH_FOUND flag to determine if the if statement should be executed + if ${MATCH_FOUND}; then + echo "Only README.md, yml, txt, gitattributes, gitignore and/or gradle files has been updated. Skipping the CI/CD workflow." # GITHUB_OUTPUT is a default GitHub env. variable echo "run_jobs=false" >> ${GITHUB_OUTPUT} else diff --git a/README.md b/README.md index 6646bdb..09f841b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ [![Dev CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml) # The Gamchha App + +## From 869d21c32e45fe0b731f8e42680b8b28a168f5e6 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 6 Aug 2023 03:27:51 +0600 Subject: [PATCH 79/84] chores: updated echo message --- .github/workflows/ci-cd-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index deee015..af8e465 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -50,7 +50,7 @@ jobs: # GITHUB_OUTPUT is a default GitHub env. variable echo "run_jobs=false" >> ${GITHUB_OUTPUT} else - echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow." + echo "Changes to files other than README.md, yml, txt, gitattributes, gitignore and/or gradle detected. Proceeding with the CI/CD workflow." echo "run_jobs=true" >> ${GITHUB_OUTPUT} fi From 6c0179f33c657c49eaa206020a356f6e3e05294b Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 6 Aug 2023 13:47:37 -0400 Subject: [PATCH 80/84] devops: use paths-ignore workflow syntax instead of lenghty logic --- .github/workflows/ci-cd-develop.yml | 7 +++++++ README.md | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index af8e465..ee8036f 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -4,6 +4,13 @@ on: push: branches: - develop + paths-ignore: + - '**/*.md' + - '**/*.yml' + - '**/*.gradle' + - '**/*.txt' + - '.gitignore' + - '.gitattributes' jobs: # Don't run CI/CD if only README.md and/or any .yml file is updated diff --git a/README.md b/README.md index 09f841b..6646bdb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ [![Dev CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml) # The Gamchha App - -## From c5e76c6727b47417dcc5b0ff9e8214a672ce4248 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 6 Aug 2023 18:35:47 -0400 Subject: [PATCH 81/84] devops: removed file pattern match logic --- .github/workflows/ci-cd-develop.yml | 50 ----------------------------- 1 file changed, 50 deletions(-) diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/ci-cd-develop.yml index ee8036f..a08940f 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/ci-cd-develop.yml @@ -13,57 +13,7 @@ on: - '.gitattributes' jobs: - # Don't run CI/CD if only README.md and/or any .yml file is updated - check_readme_yml_txt_changes: - runs-on: ubuntu-latest - outputs: - run_rest_jobs: ${{ steps.set_output.outputs.run_jobs }} - - steps: - - name: Checkout branch - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Check for README, yml or txt changes - id: set_output - run: | - # Get the list of changed files between the base and head branches - CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) - echo "CHANGED_FILES = ${CHANGED_FILES}" - - # Define the regular expression pattern for allowed file types - SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$" - echo "SKIP_FILE_TYPES = ${SKIP_FILE_TYPES}" - - # Split the CHANGED_FILES into an array - # IFS -> Internal Field Separator - IFS=' ' read -ra FILE_ARRAY <<< "${CHANGED_FILES}" - - # Initialize a flag to check if any file matches the pattern - MATCH_FOUND=true - - # Check if any file in the array matches the SKIP_FILE_TYPES pattern - for file in "${FILE_ARRAY[@]}"; do - if [[ ! ${file} =~ ${SKIP_FILE_TYPES} ]]; then - MATCH_FOUND=false - break - fi - done - - # Check the MATCH_FOUND flag to determine if the if statement should be executed - if ${MATCH_FOUND}; then - echo "Only README.md, yml, txt, gitattributes, gitignore and/or gradle files has been updated. Skipping the CI/CD workflow." - # GITHUB_OUTPUT is a default GitHub env. variable - echo "run_jobs=false" >> ${GITHUB_OUTPUT} - else - echo "Changes to files other than README.md, yml, txt, gitattributes, gitignore and/or gradle detected. Proceeding with the CI/CD workflow." - echo "run_jobs=true" >> ${GITHUB_OUTPUT} - fi - test: - needs: check_readme_yml_txt_changes - if: needs.check_readme_yml_txt_changes.outputs.run_rest_jobs == 'true' runs-on: ubuntu-latest steps: From 1333b6606fdcd2601709fd342379b95ab4067068 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 6 Aug 2023 18:37:54 -0400 Subject: [PATCH 82/84] devops: add gitattributes and gitignore to the workflow skip list for PR --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitattributes b/.gitattributes index 696e1a6..f71be8e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,5 @@ README.md merge=ours .github/workflows/*.yml merge=ours android/build.gradle merge=ours android/app/build.gradle merge=ours +.gitattributes merge=ours +.gitignore merge=ours From a125a4690e1a792b0a96ecf14498669aa366f028 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 6 Aug 2023 18:53:55 -0400 Subject: [PATCH 83/84] feat: changed colour to blue --- App.tsx | 8 ++++---- tsconfig.json | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/App.tsx b/App.tsx index 4828632..e3700f4 100644 --- a/App.tsx +++ b/App.tsx @@ -56,8 +56,8 @@ function App(): JSX.Element { ); } -const RED_COLOR = 'red'; -// const BLUE_COLOR = 'blue'; +// const RED_COLOR = 'red'; +const BLUE_COLOR = 'blue'; const styles = StyleSheet.create({ sectionHeader: { padding: 85, @@ -70,8 +70,8 @@ const styles = StyleSheet.create({ highlight: { fontSize: 24, fontWeight: '700', - // color: BLUE_COLOR, - color: RED_COLOR, + color: BLUE_COLOR, + // color: RED_COLOR, }, }); diff --git a/tsconfig.json b/tsconfig.json index 45a6c70..c5dea60 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,6 @@ { + "compilerOptions": { + "jsx": "react" + }, "extends": "@tsconfig/react-native/tsconfig.json" } From cd6ebae3afc2b8d5cee3f13ccd4927e69308a240 Mon Sep 17 00:00:00 2001 From: dg1223 Date: Sun, 6 Aug 2023 20:29:32 -0400 Subject: [PATCH 84/84] chores: bring develop and staging to parity --- .../{ci-cd-develop.yml => develop-cicd.yml} | 2 +- .github/workflows/staging-cicd.yml | 204 ++++++++++++++++++ README.md | 1 + android/app/build.gradle | 4 +- 4 files changed, 208 insertions(+), 3 deletions(-) rename .github/workflows/{ci-cd-develop.yml => develop-cicd.yml} (99%) create mode 100644 .github/workflows/staging-cicd.yml diff --git a/.github/workflows/ci-cd-develop.yml b/.github/workflows/develop-cicd.yml similarity index 99% rename from .github/workflows/ci-cd-develop.yml rename to .github/workflows/develop-cicd.yml index a08940f..498d48c 100644 --- a/.github/workflows/ci-cd-develop.yml +++ b/.github/workflows/develop-cicd.yml @@ -198,4 +198,4 @@ jobs: status: draft # userFraction: 0.5 whatsNewDirectory: android/release-notes/ - releaseName: v1.0.5 + releaseName: v1.0.6 diff --git a/.github/workflows/staging-cicd.yml b/.github/workflows/staging-cicd.yml new file mode 100644 index 0000000..b12b8b2 --- /dev/null +++ b/.github/workflows/staging-cicd.yml @@ -0,0 +1,204 @@ +name: Staging CI/CD + +on: + pull_request: + branches: + - staging + paths-ignore: + - '**/*.md' + - '**/*.yml' + - '**/*.gradle' + - '**/*.txt' + - '.gitignore' + - '.gitattributes' + types: + - closed + +jobs: + test: + # only run workflow after PR is merged + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + - name: Checkout branch + uses: actions/checkout@v3 + + # Cache npm dependencies (from GitHub docs) + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + # If there's a cache miss + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + # Caching process complete + + - name: Install dependencies + run: npm install + + - name: Lint check + run: npm run lint + + - name: Run tests + run: npm run test + + deploy: + needs: test + # default action is success(): if(success) + runs-on: ubuntu-latest + env: + MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_ALIAS }} + MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + + steps: + # We need to checkout the current branch and install node + # dependencies again because every GH Actions job runs on + # a seperate runner (VM) + - name: Checkout branch + uses: actions/checkout@v3 + + # Cache npm dependencies (from GitHub docs) + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + # If there's a cache miss + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + # Caching process complete + + - name: Install dependencies + run: npm install + + # - name: Read Version + # id: read-version + # run: | + # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" + # echo "::set-output name=versionName::$(jq -r '.versionName' version.json)" + + # # echo "::set-output name=versionCode::$(jq -r '.versionCode' version.json)" + # # echo "::set-output name=versionName::$(node -p -e "require('./version.json').versionName")" + + # - name: Increment Version + # id: increment-version + # run: | + # echo "::set-output name=versionCode::$(node -p \"parseInt('${{ steps.read-version.outputs.versionCode }}') + 1\")" + # echo "::set-output name=versionName::$(node -p \"'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))\")" + + # # echo "::set-output name=versionCode::$(node -p -e 'parseInt(${ steps.read-version.outputs.versionCode }) + 1')" + # # echo "::set-output name=versionName::$(node -p -e "'${{ steps.read-version.outputs.versionName }}'.replace(/(\\d+\\.\\d+\\.)(\\d+)/, (_, p1, p2) => p1 + (parseInt(p2) + 1))")" + + # - name: Update build.gradle + # run: | + # sed -i "s/versionCode .*/versionCode ${{ steps.increment-version.outputs.versionCode }}/" android/app/build.gradle + # sed -i "s/versionName .*/versionName '${{ steps.increment-version.outputs.versionName }}'/" android/app/build.gradle + + # - name: Commit and Push Changes + # uses: stefanzweifel/git-auto-commit-action@v4 + # with: + # commit_message: devops - update versionCode and versionName [skip ci] + + - name: Cache Gradle Wrapper + uses: actions/cache@v3 + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + + - name: Cache Gradle Dependencies + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: ${{ runner.os }}-gradle-caches- + + # Start the build process + - name: Make Gradlew Executable + run: cd android && chmod +x ./gradlew + + # - name: Generate App APK + # run: | + # cd android && ./gradlew assembleRelease --no-daemon + + # - name: Sign generated APK + # id: sign_app + # uses: r0adkll/sign-android-release@v1 + # with: + # releaseDirectory: android/app/build/outputs/apk/release + # signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} + # alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} + # keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + # keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + + # - name: Check app directory after signing (debug) + # run: | + # ls -a android/app/build/outputs/apk/release + + - name: Build Android App Bundle + run: cd android && ./gradlew bundleRelease --no-daemon + + - name: Sign App Bundle + id: sign_app + uses: r0adkll/sign-android-release@v1 + with: + releaseDirectory: android/app/build/outputs/bundle/release + signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} + alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} + keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + + # ## Distribute app to Firebase App Distribution for testing + # ## Use google play internal track if you have a google play account + # ## (uncomment the sections below if you want to use Play Store) + # - name: Upload artifact to Firebase App Distribution + # uses: wzieba/Firebase-Distribution-Github-Action@v1 + # with: + # appId: ${{secrets.ANDROID_FIREBASE_APP_ID}} + # token: ${{secrets.ANDROID_FIREBASE_TOKEN}} + # groups: testers + # file: ${{steps.sign_app.outputs.signedReleaseFile}} + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: Signed App Bundle + path: ${{steps.sign_app.outputs.signedReleaseFile}} + + - name: Deploy to Play Store (Alpha) + uses: r0adkll/upload-google-play@v1 + with: + serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} + # The packageName must already exist in the play console account, so make sure you upload a manual apk or aab first through the console + # https://github.com/r0adkll/upload-google-play/tree/v1/ + packageName: com.thebest.gamchha + releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} + track: alpha + inAppUpdatePriority: 3 + userFraction: 0.5 + whatsNewDirectory: android/release-notes/ + releaseName: v1.0.0.a diff --git a/README.md b/README.md index 6646bdb..4b07eb3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ [![Dev CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/ci-cd-develop.yml) +[![Staging CI/CD](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml/badge.svg)](https://github.com/dg1223/Gamchha/actions/workflows/staging-cd.yml) # The Gamchha App diff --git a/android/app/build.gradle b/android/app/build.gradle index 2956b5a..f754f1f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -91,8 +91,8 @@ android { applicationId "com.thebest.gamchha" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 6 - versionName "1.0.5" + versionCode 7 + versionName "1.0.6" } signingConfigs { debug {