Beta - Build and Deploy #317
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
name: Beta - Build and Deploy | |
on: | |
push: | |
branches: | |
- 'develop' | |
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 or its ancestor | |
type: string | |
analyze_archive: | |
description: > | |
Whether the archive should be analyzed during the build process (default: false) | |
type: boolean | |
default: false | |
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 | |
continue-on-error: true | |
with: | |
action: 'getIssuesSummary' | |
issues: '${{ steps.git-diff.outputs.issues }}' | |
- name: Jira Check Version | |
id: jira-check-version | |
if: false # TODO: Enable, requires IOS-8785 | |
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-8785 | |
# 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-8785 | |
uses: tangem/jira-action@master | |
with: | |
action: 'setVersionToIssues' | |
project: 'IOS' | |
version: '${{ env.next_version_name }}' | |
issues: '${{ steps.git-diff.outputs.issues }}' | |
build: | |
name: Tangem Beta | |
needs: prepare | |
uses: tangem/actions/.github/workflows/build.yml@main | |
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 }}' | |
# GA boolean inputs are just awful https://stackoverflow.com/questions/76292948 | |
# The reusable workflow requires all input params to be of type string, so we use this ugly ternary operator here | |
analyze_archive: ${{ inputs.analyze_archive == true && 'true' || 'false' }} | |
secrets: | |
FIREBASE_APP_ID: '${{ secrets.FIREBASE_APP_ID }}' | |
GH_MOBILE_PAT: '${{ secrets.GH_MOBILE_PAT }}' | |
deploy: | |
name: Google Distribution | |
uses: tangem/actions/.github/workflows/deploy-firebase.yml@main | |
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@main | |
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() | |
uses: tangem/actions/.github/workflows/notification.yml@main | |
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 }}' |