{"id":13295982,"url":"https://github.com/MGamalE/Android-CICD","last_synced_at":"2025-03-10T08:31:49.504Z","repository":{"id":43895578,"uuid":"418081602","full_name":"MGamalE/Android-CICD","owner":"MGamalE","description":"This repo demonstrates how to work on CI/CD for Mobile Apps :iphone: using Github Actions :pill: + Firebase Distribution :tada:","archived":false,"fork":false,"pushed_at":"2021-11-21T22:45:24.000Z","size":2471,"stargazers_count":57,"open_issues_count":0,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-29T17:44:14.446Z","etag":null,"topics":["actions","actionshackathon21","android","android-ci","ci","ci-cd","cicd","continuous-delivery","continuous-deployment","continuous-integration","firebase","firebase-distribution","github-actions","kotlin-android","linter","linting","sonarcloud","sonarqube","static-code-analysis"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MGamalE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-17T09:40:48.000Z","updated_at":"2024-05-31T01:19:08.000Z","dependencies_parsed_at":"2022-08-23T10:40:43.676Z","dependency_job_id":null,"html_url":"https://github.com/MGamalE/Android-CICD","commit_stats":null,"previous_names":["mgamale/android-cicd"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGamalE%2FAndroid-CICD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGamalE%2FAndroid-CICD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGamalE%2FAndroid-CICD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGamalE%2FAndroid-CICD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MGamalE","download_url":"https://codeload.github.com/MGamalE/Android-CICD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242819241,"owners_count":20190400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","actionshackathon21","android","android-ci","ci","ci-cd","cicd","continuous-delivery","continuous-deployment","continuous-integration","firebase","firebase-distribution","github-actions","kotlin-android","linter","linting","sonarcloud","sonarqube","static-code-analysis"],"created_at":"2024-07-29T17:18:10.732Z","updated_at":"2025-03-10T08:31:49.051Z","avatar_url":"https://github.com/MGamalE.png","language":"Kotlin","readme":"## Android-CICD\n\nThis repo demonstrates how to work on CI/CD for Mobile Apps :iphone: using Github Actions :pill: + Firebase Distribution :tada:\n\n# Getting Started \n\nWe are here setup a continious integration pipelines using [**Github Actions**](https://github.com/features/actions) and a continious delivery using [**Firebase Distribution**](https://firebase.google.com/docs/app-distribution) ⚡ ⚡\n\nIf you want to know a brief definition for the two terms CI/CD 🙆‍♂️, Checkout out the quotes :\n\n  * [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration)\n\n    \u003e Is the practice of merging all developers' working copies to a shared mainline several times a day.\n\n * [Continuous Delivery](https://en.wikipedia.org/wiki/Continuous_delivery)\n\n    \u003e Is a software engineering approach in which teams produce software in short cycles, \n    \u003e ensuring that the software can be reliably released at any time and, when releasing the software, without doing so manually.\n\n\n ![CI/CD](https://github.com/MohamedGElsharkawy/Android-CICD/blob/master/CI-CD-Image.png)\n\n\n# Workflows \n\n  * 🚀 [pre_check.yaml](https://github.com/MohamedGElsharkawy/Android-CICD/blob/master/.github/workflows/pre_check.yml) : This workflow have to check for lint, testing and static code analyzer \n  * 🚀 [build.yaml](https://github.com/MohamedGElsharkawy/Android-CICD/blob/master/.github/workflows/build.yml) : This workflow have to build and deploy to firebase distribution\n\n## Getting Started With CI ⚡\n\n To get start with build CI pipelines, you should use **Actions tab** or create a new **YAML** file, then you could setup your workflow, please checkout [Metadata syntax for GitHub Actions](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions) :monocle_face:\n \n ### How to create your own workflow \n\n1. **name** \n\n\u003e Name of your workflow \n\n2. **on** \n\n\u003e Control when the workflow will be triggerd\n\n3. **jobs** \n\n\u003e Deterimne one or more jobs / pipelines to run for the workflow, but you have to specifiy some parameters to run the job\n\n   * **job_name** \n\n   \u003e Pick up your own job name\n\n   * **runs_on**\n\n   \u003e Specify your runner type\n\n   * **steps**\n\n   \u003e Represent a squence of tasks will be exceuted for each job / pipeline, each step have a some of parameters\n\n  * **uses**\n\n   \u003e One of step parameters, you can use it when your are trying to install enviornment or repository from marketplace \n\n  * **run**\n\n   \u003e One of step parameters, you can use it when your are trying to hit a command \n\n\n### CI Sample :partying_face:\n\nThis workflow run as a lint checker for each **Pushing** on master branch :rocket:\n\n```\nname: Build lint checker report\n\non:\n  push:\n    branches: [ master ]\n\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps: \n      - name: Checkout\n        uses: actions/checkout@v2\n\n      - name: Setup Java JDK\n        uses: actions/setup-java@v1\n        with:\n          java-version: 1.8\n\n      - name: Build Lint\n        run: ./gradlew lintDebug\n    \n      - name: Upload Build Lint Report\n        uses: actions/upload-artifact@v2\n        with:\n          name: report\n          path: app/build/reports/lint-results-debug.html\n```\n\n\n* [Checkout](https://github.com/marketplace/actions/checkout) : This action checks-out your repository under `$GITHUB_WORKSPACE`, so your workflow can access it.\n* [Setup Java JDK](https://github.com/marketplace/actions/setup-java-jdk)\n* Build Lint : Run lint report \n* [Upload Build Lint Report](https://github.com/marketplace/actions/upload-a-build-artifact) : This uploads artifacts from your workflow allowing you to share data between jobs and store data once a workflow is complete.\n\n\n## Getting Started With CD ⚡\n\nTo get start with build CD pipelines, you should integrate your app with **Firebase Distribution**, then you could setup your workflow, please checkout [Firebase Distribution](https://firebase.google.com/docs/app-distribution) for more how to integrate your app with firebase :monocle_face:\n\n\u003e Firebase App Distribution makes distributing your apps to trusted testers painless. By getting your apps onto testers' devices quickly, you can get feedback early and often. \n\n\n### CD Sample :partying_face:\n\nThis workflow builds a debug APK, then upload the artifact APK to a workflow dashboard and send another one to testers group on firebase distributions dashboard after each **Pull Request** on master branch 🚀\n\n```\nname: Integrate Firebase Distributions + Github Actions\n\non:\n  pull_request_target:\n    branches: [ master ]\n\njobs:\n  builds:\n    runs-on: ubuntu-latest\n    steps: \n      - name: Checkout\n        uses: actions/checkout@v2\n        \n      - name: Setup Java JDK\n        uses: actions/setup-java@v1\n        with:\n         java-version: 1.8\n        \n      - name: Build Gradle\n        run: ./gradlew build\n    \n      - name: Upload a Build Artifact\n        uses: actions/upload-artifact@v2\n        with:\n          name: app\n          path: app/build/outputs/apk/debug/app-debug.apk\n          \n      - name: Upload Artifact To Firebase App Distribution\n        uses: wzieba/Firebase-Distribution-Github-Action@v1.3.2\n        with:\n          appId: ${{ secrets.FIREBASE_ID }}\n          token: ${{ secrets.FIREBASE_TOKEN }}\n          groups: Android-CICD-Testers\n          releaseNotes: \"Hey! This my first integrate Firebase distributions with Github Actions\"\n          file: app/build/outputs/apk/debug/app-debug.apk   \n```\n\n* Build Gradle : Build your APK.\n* [Upload Artifact To Firebase App Distribution](https://github.com/wzieba/Firebase-Distribution-Github-Action) : This action uploads artifacts (.apk,.aab) to Firebase App Distribution.\n* appId : Get it from your project settings on firebase console.\n* token : Run this command `firebase login:ci`, for more informations about how to get your firbase token, check out [Firebase CLI](https://firebase.google.com/docs/cli)\n\n\u003e **Secrets** : This path to encrypt your sensitive information, you can access it from **Settings/Secrets Tab**, for more info checkout out [Encrypted Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets)\n\n\n\n\n #### Screenshot from firebase distribution dashboard after sending the debug_app using Actions workflow\n ![Release](https://github.com/MohamedGElsharkawy/Android-CICD/blob/master/release_apk.png)\n \n ### [How to integrate your project wih sonarcloud code analysis](https://github.com/MohamedGElsharkawy/Android-CICD/blob/master/Sonar-Cloud.md)\n\n## Contributing \nDon't hesitate to contribute with any updates or improves, just fork this repository, make the change you'd like and then submit a pull request.\n\n## Issues\nNotice any issues with a repository? Please file a [Github Issue](https://github.com/MohamedGElsharkawy/Android-CICD/issues) in this repository.\n\n## License\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2021 MohamedGElsharkawy\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMGamalE%2FAndroid-CICD","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMGamalE%2FAndroid-CICD","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMGamalE%2FAndroid-CICD/lists"}