Skip to content

IOS-8113: Add Jira refs, disable currently unused actions #103

IOS-8113: Add Jira refs, disable currently unused actions

IOS-8113: Add Jira refs, disable currently unused actions #103

name: Beta - Build and Deploy
on:
push:
branches:
- 'develop' # TODO: prevent triggering when merging release* branches
- 'feature/IOS-8113_ci_cd_beta_builds_workflow' # TODO: Test only, remove
workflow_dispatch:
inputs:
build_description:
description: >
Optional additional info about the build
type: string
xcode_version_override:
description: >
Optional Xcode version override. Leave blank (default value) to use the default Xcode version;
pass a custom value (e.g. '16.0', '10.2.1', '11 Beta 7', '11.2 GM seed', etc) to use a different Xcode version for the build
type: string
base_branch:
description: >
Optional base branch for constructing Jira issues diff.
Leave blank (default value) to use the most recent release branch ('releases/*') created from the current branch
type: string
concurrency:
group: '${{ github.workflow }} (${{ github.head_ref || github.ref_name }})'
cancel-in-progress: true
env:
next_version_name: 'Next Release'
should_find_latest_release_branch: ${{ !inputs.base_branch || inputs.base_branch == '' }}
jobs:
prepare:
name: Prepare information
runs-on: ubuntu-latest
outputs:
version: 'develop'
stage: 'Beta'
build_number: '${{ github.run_number }}'
jira-issues-summary: '${{ steps.jira-issues-summary.outputs.result }}'
steps:
- name: Checkout 'find-latest-release-branch' script
if: ${{ env.should_find_latest_release_branch == 'true' }}
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
Utilites/find-latest-release-branch.sh
sparse-checkout-cone-mode: false
- name: Find latest release branch
id: find-latest-release-branch
if: ${{ env.should_find_latest_release_branch == 'true' }}
run: |
./Utilites/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/github-action@main
with:
github-token: '${{ secrets.GH_MOBILE_PAT }}'
base: '${{ inputs.base_branch || steps.find-latest-release-branch.outputs.result }}'
head: '${{ github.ref_name }}'
- 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: Jira Get Issues Summary
uses: tangem/jira-action@master
id: jira-issues-summary
with:
action: 'getIssuesSummary'
issues: '${{ steps.git-diff.outputs.issues }}'
- name: Jira Check Version
id: jira-check-version
if: false # TODO: Enable, requires IOS-8508
uses: tangem/jira-action@master
with:
action: 'checkVersion'
project: 'IOS'
version: '${{ env.next_version_name }}'
- name: Jira Create Version
if: false # TODO: Enable, requires IOS-8508
# if: ${{ steps.jira-check-version.outputs.result == 'false' }}
uses: tangem/jira-action@master
with:
action: 'createVersion'
project: 'IOS'
version: '${{ env.next_version_name }}'
- name: Jira Set Version To Issues
if: false # TODO: Enable, requires IOS-8508
uses: tangem/jira-action@master
with:
action: 'setVersionToIssues'
project: 'IOS'
version: '${{ env.next_version_name }}'
issues: '${{ steps.git-diff.outputs.issues }}'
# TODO: Remove
- name: Debug
env:
JIRA_ISSUES: '${{ steps.jira-issues-summary.outputs.result }}'
run: |
echo "Has version: '${{ steps.jira-check-version.outputs.result }}'"
cat <<EOF
Jira issues:
${JIRA_ISSUES}
EOF
build:
name: Tangem Beta
needs: prepare
uses: tangem/actions/.github/workflows/build.yml@test/IOS-8112_ci_cd_alpha_builds_workflow
with:
stage: '${{ needs.prepare.outputs.stage }}'
version: '${{ needs.prepare.outputs.version }}'
build_number: '${{ needs.prepare.outputs.build_number }}'
path: 'fastlane/builds/'
filename: 'Tangem-${{ needs.prepare.outputs.stage }}-${{ needs.prepare.outputs.version }}(${{ needs.prepare.outputs.build_number }}).ipa'
xcode_version_override: '${{ inputs.xcode_version_override }}'
secrets:
GH_MOBILE_PAT: '${{ secrets.GH_MOBILE_PAT }}'
deploy:
name: Google Distribution
uses: tangem/actions/.github/workflows/deploy-firebase.yml@test/IOS-8112_ci_cd_alpha_builds_workflow
needs:
- prepare
- build
with:
stage: '${{ needs.prepare.outputs.stage }}'
version: '${{ needs.prepare.outputs.version }}'
build_number: '${{ needs.prepare.outputs.build_number }}'
changelog: '${{ needs.prepare.outputs.jira-issues-summary }}'
build_description: '${{ inputs.build_description }}'
filename: 'Tangem-${{ needs.prepare.outputs.stage }}-${{ needs.prepare.outputs.version }}(${{ needs.prepare.outputs.build_number }}).ipa'
secrets:
FIREBASE_APP_ID: '${{ secrets.FIREBASE_APP_ID }}'
FIREBASE_CLI_TOKEN: '${{ secrets.FIREBASE_CLI_TOKEN }}'
GH_MOBILE_PAT: '${{ secrets.GH_MOBILE_PAT }}'
notification:
name: Deploy Notification
uses: tangem/actions/.github/workflows/notification.yml@test/IOS-8112_ci_cd_alpha_builds_workflow
needs:
- prepare
- build
- deploy
with:
channel: '${{ vars.SLACK_CHANNEL_DEPLOYMENTS_IOS }}'
status: 'success'
app_name: '${{ vars.APP_BETA }}'
deploy_to: '${{ vars.DEPLOYMENT_GOOGLE_DISTRIBUTION }}'
version: '${{ needs.prepare.outputs.version }}'
build_number: '${{ needs.prepare.outputs.build_number }}'
changelog: '${{ needs.prepare.outputs.jira-issues-summary }}'
build_description: '${{ inputs.build_description }}'
encoded_release_url: '${{ needs.deploy.outputs.encoded_release_url }}'
secrets:
SLACK_BOT_TOKEN: '${{ secrets.SLACK_BOT_TOKEN }}'
error_notification:
name: Error Notification
# if: failure()
if: false # TODO: Test only, remove
uses: tangem/actions/.github/workflows/notification.yml@test/IOS-8112_ci_cd_alpha_builds_workflow
needs:
- prepare
- build
with:
channel: '${{ vars.SLACK_CHANNEL_DEPLOYMENTS_IOS }}'
status: 'error'
app_name: '${{ vars.APP_BETA }}'
deploy_to: '${{ vars.DEPLOYMENT_GOOGLE_DISTRIBUTION }}'
version: '${{ needs.prepare.outputs.version }}'
build_number: '${{ needs.prepare.outputs.build_number }}'
changelog: '${{ needs.prepare.outputs.jira-issues-summary }}'
secrets:
SLACK_BOT_TOKEN: '${{ secrets.SLACK_BOT_TOKEN }}'