-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AND-9419 Added stub for GP uploading action. (#3987)
- Loading branch information
Showing
1 changed file
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
name: Deploy to Google Play Internal | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
build_description: | ||
description: > | ||
Optional additional info about the build | ||
type: string | ||
workflow_call: | ||
secrets: | ||
FIREBASE_APP_ID_INTERNAL: | ||
required: true | ||
FIREBASE_CLI_TOKEN: | ||
required: true | ||
# Token must have read access to all the submodule repositories | ||
GH_MOBILE_PAT: | ||
required: true | ||
|
||
env: | ||
INITIAL_VERSION_CODE: ${{ 1000 }} | ||
|
||
jobs: | ||
build_and_upload: | ||
name: Upload apk to Firebase | ||
runs-on: [ self-hosted, ARM64, active-android, Linux ] | ||
environment: Alpha | ||
outputs: | ||
version_name: ${{ steps.get_version_name.outputs.versionName }} | ||
version_code: ${{ steps.get_version_code.outputs.versionCode }} | ||
jira_summary: ${{ steps.jira.outputs.summary }} | ||
steps: | ||
- name: Jira Login | ||
uses: atlassian/gajira-login@master | ||
env: | ||
JIRA_BASE_URL: ${{ secrets.JIRA_URL }} | ||
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER }} | ||
JIRA_API_TOKEN: ${{ secrets.JIRA_TOKEN }} | ||
|
||
- name: Get Jira Issue Number from Branch Name | ||
id: jira | ||
uses: tangem/jira-action@master | ||
with: | ||
action: getBranchSummary | ||
branch-name: ${{ github.ref_name }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
token: ${{ secrets.GH_MOBILE_PAT }} | ||
|
||
- name: Build Docker image | ||
run: | | ||
docker build --platform linux/arm64 -t tangem_ci_android_environment . | ||
- name: Increment version code | ||
id: get_version_code | ||
env: | ||
RUN_NUMBER: ${{ github.run_number }} | ||
run: | | ||
VERSION_CODE=$((RUN_NUMBER + $INITIAL_VERSION_CODE)) | ||
echo "versionCode=$VERSION_CODE" >> $GITHUB_OUTPUT | ||
- name: Read version.properties file | ||
id: get_version_name | ||
uses: BrycensRanch/read-properties-action@v1 | ||
with: | ||
file: version.properties | ||
property: versionName | ||
default: 0.0.1 | ||
|
||
- name: Run uploading | ||
id: uploading | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | ||
app_id_internal: ${{ secrets.FIREBASE_APP_ID_INTERNAL }} | ||
apk_path_internal: app/build/outputs/apk/internal/app-internal.apk | ||
version_code: ${{ steps.get_version_code.outputs.versionCode }} | ||
version_name: ${{ steps.get_version_name.outputs.versionName }} | ||
release_notes: ${{ github.ref_name }} - ${{ github.sha }} | ||
groups: testers | ||
run: | | ||
env > .env | ||
docker run --rm \ | ||
--user ubuntu \ | ||
--env-file .env \ | ||
--volume ~/.gradle:/home/ubuntu/.gradle \ | ||
--volume ${{ github.workspace }}:/workspace \ | ||
--volume $GITHUB_OUTPUT:/workspace/github_output.txt \ | ||
tangem_ci_android_environment \ | ||
sh -c " | ||
cd /workspace; | ||
echo 'Deploying APK to Google Play Internal...'; | ||
fastlane build; | ||
" | ||
notification: | ||
name: Send Notification | ||
needs: build_and_upload | ||
uses: tangem/actions/.github/workflows/notification.yml@main | ||
with: | ||
channel: 'deployments-android' | ||
status: 'success' | ||
app_name: 'Tangem Release' | ||
deploy_to: 'Google Play Internal' | ||
version: ${{ needs.build_and_upload.outputs.version_name }} | ||
build_number: ${{ needs.build_and_upload.outputs.version_code }} | ||
changelog: ${{ needs.build_and_upload.outputs.jira_summary }} | ||
build_description: ${{ inputs.build_description }} | ||
encoded_release_url: ${{ needs.build_and_upload.outputs.encoded_release_url }} | ||
secrets: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
error_notification: | ||
name: Error Notification | ||
needs: build_and_upload | ||
if: failure() | ||
uses: tangem/actions/.github/workflows/notification.yml@main | ||
with: | ||
channel: 'deployments-android' | ||
status: 'error' | ||
app_name: 'Tangem Release' | ||
deploy_to: 'Google Play Internal' | ||
version: ${{ needs.build_and_upload.outputs.version_name }} | ||
build_number: ${{ needs.build_and_upload.outputs.version_code }} | ||
changelog: ${{ needs.build_and_upload.outputs.jira_summary }} | ||
build_description: ${{ inputs.build_description }} | ||
encoded_release_url: ${{ needs.build_and_upload.outputs.encoded_release_url }} | ||
secrets: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |