-
Open Android project template and use it to create new repository. Preferred repo name is [productname]-android, where [productname] includes only name of the product, without client name.
-
Change following in newly created repository:
- Update Readme.md
- Change project name to real project name
- Change applicationId
- Change packages from
com.thefuntasty.androidprojecttemplate
to real packages based on applicationId
-
Create
develop
branch and set it as a default branch. -
Disable Wiki, Issues, Projects features we do not use.
-
Enable Automatically delete head branches so there is no need to delete branches manually after each PR merge.
-
Add branch ruleset
develop|main
- set targets as shown in the following screenshot:
- Set required approvals
- Set status checks
(NOTE: Status checks (GitHub Actions, Danger, etc.) become visible after first created pull request. Do not forget to set them afterwards.
- Create new branch
feature/PROJ-1-setup-project
where everything will be set up in next steps.
- Create 2 new Firebase projects. First for:
Debug
+Enterprise
and second forProd
. Or access an existing one from the client. - If you created 2 new Firebase projects from scratch, continue with this setup or individually if you have Firebase from the client:
- Debug + Enterprise
- Add Android app for
debug
andenterprise
and set SHA-1 from debug keystore.
- Add Android app for
- Prod
- Add Android app for
prod
- Set Project Settings / Environment type to
Production
- SHA-1: you will probably be using Play App Signing by Google, so the SHA-1 can be filled in later
- Add Android app for
- Debug + Enterprise
Tips:
Get SHA-1 fordebug
keystore:keytool -list -v -keystore debug.jks -alias androiddebugkey -storepass android
To create different package name with suffix, add buildTypes/applicationIdSuffix to gradle for all build types.
If you want to generate release/upload keystore right now see Generate an upload key and keystore and put password, alias and keystore to Bitwarden.
Additional info:
The Google Cloud project is created automatically with the created Firebase project.
-
Select
Debug + Enterprise
project and click onGet started
button. -
Add Tester groups
Futured QA
andDevs
. Create invite link and send it to the Slack channel. -
Authorizing upload to Firebase. There are two ways of authorizing upload to Firebase.
- By Service account JSON, which is a preferred way
- Go to Google Cloud Console and find your project by name
- Go to APIs & Services / Credentials / Create Credentials / Service Account
- Set service account name (i.e.:Firebase App Distribution) and set description
- Set role:
Firebase App Distribution Admin
- Create new key with type
JSON
: click on new created service account / Keys / Add key - Create new repository secret
APP_DISTRIBUTION_SERVICE_ACCOUNT
with the JSON content
- By using
FIREBASE_TOKEN
, which can be generated using Firebase CLI
- By Service account JSON, which is a preferred way
Make sure that you have enabled google services plugin, otherwise the plugin won't know the id of the app
-
If you created a new project using Android project template, the GitHub Actions workflow files are already present in your repository under
.github/workflows
folder. If not, copy them over from here). -
In Settings tab of your repository, go to Secrets and configure following secrets:
DANGER_GITHUB_API_TOKEN
SLACK_WEB_HOOK
APP_DISTRIBUTION_SERVICE_ACCOUNT
-
For each workflow configuration file, configure the environment variables marked with
TODO
comment:SLACK_CHANNEL
APP_DISTRIBUTION_GROUPS
-
Make a pull request from
feature/PROJ-1-setup-project
todevelop
to ensure that GitHub Actions work properly