Skip to content

.github/workflows/publish_firebase.yml #19

.github/workflows/publish_firebase.yml

.github/workflows/publish_firebase.yml #19

name: Publish internal build to Firebase AD
on:
push:
branches:
- 'develop'
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
jobs:
jira_changelog:
name: Jira changelog
runs-on: ubuntu-latest
outputs:
jira_pure_changelog: ${{ steps.jira-issues-summary.outputs.result }}
jira_grouped_by_parent_changelog: ${{ steps.jira-grouped-by-parent-issues-summary.outputs.result }}
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: Checkout
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.GH_MOBILE_PAT }}
fetch-depth: 0
- name: Find latest release branch
id: find-latest-release-branch
run: |
./tangem-android-tools/CI/shell_scripts/find-latest-release-branch.sh '${{ github.ref_name }}'
echo "result=$(< 'find-latest-release-branch.output')" >> $GITHUB_OUTPUT
- name: Get unreleased tasks
id: git-diff
uses: tangem-developments/github-action@main
with:
github-token: '${{ secrets.GH_MOBILE_PAT }}'
base: '${{ steps.find-latest-release-branch.outputs.result }}'
head: '${{ github.ref_name }}'
- name: Jira Get Issues Summary
uses: tangem-developments/jira-action@master
id: jira-issues-summary
with:
action: getIssuesSummary
issues: ${{ steps.git-diff.outputs.issues }}
- name: Jira Get Issues Summary
uses: tangem-developments/jira-action@feature/AND-10574_group_changelog_tasks_by_parent
id: jira-grouped-by-parent-issues-summary
with:
action: getGroupedByParentIssuesSummary
issues: ${{ steps.git-diff.outputs.issues }}
- name: Print issues
id: print_issues
run: |
echo "Issues:"
echo "${{ steps.jira-issues-summary.outputs.result }}"
echo "Grouped issues:"
echo "${{ steps.jira-grouped-by-parent-issues-summary.outputs.result }}"
build_and_publish:
name: Build and publish
runs-on: [ self-hosted, active-android, build ]
environment: Alpha # required for obtaining token
needs: jira_changelog
outputs:
encoded_release_url: ${{ steps.publish.outputs.encoded_release_url }}
version_name: ${{ steps.get_version_name.outputs.versionName }}
version_code: ${{ steps.get_version_code.outputs.versionCode }}
steps:
- name: Clean workspace
run: |
echo "Cleaning workspace: $(pwd)"
rm -rf ./* .[^.]* .??*
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.GH_MOBILE_PAT }}
fetch-depth: 0
- name: Increment version code
id: get_version_code
env:
RUN_NUMBER: ${{ github.run_number }}
INITIAL_VERSION_CODE: 1050
run: |
VERSION_CODE=$((RUN_NUMBER + INITIAL_VERSION_CODE))
echo "versionCode=$VERSION_CODE" >> $GITHUB_OUTPUT
- name: Get version name from branch name
id: get_version_name
run: |
BRANCH=${{ github.ref_name }}
if [[ "$BRANCH" =~ ^(releases|hotfix)/([0-9]+)\.([0-9]+)(\.[0-9]+)?$ ]]; then
MAJOR=${BASH_REMATCH[2]}
MINOR=${BASH_REMATCH[3]}
PATCH=${BASH_REMATCH[4]:-.0}
VERSION="${MAJOR}.${MINOR}${PATCH}"
else
./tangem-android-tools/CI/shell_scripts/find-latest-release-branch.sh origin/$BRANCH
LATEST_BRANCH=$(< 'find-latest-release-branch.output')
if [[ "$LATEST_BRANCH" =~ releases/([0-9]+)\.([0-9]+) ]]; then
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
NEW_MINOR=$((MINOR + 1))
VERSION="${MAJOR}.${NEW_MINOR}.0"
else
echo "Failed to get version"
exit 1
fi
fi
echo "versionName=$VERSION"
echo "versionName=$VERSION" >> $GITHUB_OUTPUT
- name: Build Docker image
run: |
docker build --platform linux/arm64 -t tangem_ci_android_environment -f tangem-android-tools/CI/dockerfiles/Dockerfile.android .
- name: Build internal
id: build
env:
GITHUB_TOKEN: ${{ secrets.GH_MOBILE_PAT }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
version_code: ${{ steps.get_version_code.outputs.versionCode }}
version_name: ${{ steps.get_version_name.outputs.versionName }}
run: |
env > .env
docker run --rm \
--user ubuntu \
--env-file .env \
--volume ~/.gradle:/home/ubuntu/.gradle \
--volume ${{ github.workspace }}:/workspace \
tangem_ci_android_environment \
bash -c '
cd /workspace;
fastlane buildInternal;
'
- name: Publish to Firebase
id: publish
env:
GITHUB_TOKEN: ${{ secrets.GH_MOBILE_PAT }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
app_id_internal: ${{ secrets.FIREBASE_APP_ID_INTERNAL }}
firebase_cli_token: ${{ secrets.FIREBASE_CLI_TOKEN }}
apk_path_internal: app/build/outputs/apk/internal/app-internal.apk
release_notes: ${{ github.ref_name }} - ${{ github.sha }}
groups: testers
run: |
env > .env
docker run --rm \
--user ubuntu \
--env-file .env \
--volume ${{ github.workspace }}:/workspace \
--volume $GITHUB_OUTPUT:/workspace/github_output.txt \
tangem_ci_android_environment \
bash -c '
cd /workspace;
fastlane publishToFirebase;
'
notification:
name: Send Notification
needs:
- jira_changelog
- build_and_publish
uses: tangem-developments/actions/.github/workflows/notification.yml@main

Check failure on line 197 in .github/workflows/publish_firebase.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish_firebase.yml

Invalid workflow file

error parsing called workflow ".github/workflows/publish_firebase.yml" -> "tangem-developments/actions/.github/workflows/notification.yml@main" : workflow was not found. See https://docs.github.com/actions/learn-github-actions/reusing-workflows#access-to-reusable-workflows for more information.
with:
channel: 'deployments-android'
status: 'success'
deploy_to: 'Firebase app distribution'
version: ${{ needs.build_and_publish.outputs.version_name }}
build_number: ${{ needs.build_and_publish.outputs.version_code }}
changelog: ${{ needs.jira_changelog.outputs.jira_grouped_by_parent_changelog }}
pure_changelog: ${{ needs.jira_changelog.outputs.jira_pure_changelog }}
build_description: ${{ inputs.build_description }}
encoded_release_url: ${{ needs.build_and_publish.outputs.encoded_release_url }}
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
error_notification:
name: Error Notification
needs:
- jira_changelog
- build_and_publish
if: failure()
uses: tangem-developments/actions/.github/workflows/notification.yml@main
with:
channel: 'deployments-android'
status: 'error'
deploy_to: 'Firebase App Distribution'
version: ${{ needs.build_and_publish.outputs.version_name }}
build_number: ${{ needs.build_and_publish.outputs.version_code }}
changelog: ${{ needs.jira_changelog.outputs.jira_grouped_by_parent_changelog }}
pure_changelog: ${{ needs.jira_changelog.outputs.jira_pure_changelog }}
build_description: ${{ inputs.build_description }}
encoded_release_url: ${{ needs.build_and_publish.outputs.encoded_release_url }}
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}