Skip to content

Build Hotfix Release #22

Build Hotfix Release

Build Hotfix Release #22

name: Build Hotfix Release
on:
workflow_dispatch:
inputs:
asana-task-url:
description: "Asana release task URL"
required: true
type: string
base-branch:
description: "Base branch (defaults to main, only override for testing)"
required: false
type: string
current-internal-release-branch:
description: "Current internal release branch (to merge hotfix branch to - hotfix branch is merged to main if this is not provided)"
required: false
type: string
jobs:
assert_release_branch:
name: Assert Hotfix Branch
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Assert hotfix release branch
run: |
case "${{ github.ref }}" in
refs/heads/hotfix/*) ;;
*) echo "👎 Not a hotfix release branch"; exit 1 ;;
esac
run_tests:
name: Run Tests
needs: assert_release_branch
uses: ./.github/workflows/pr.yml
secrets:
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
SSH_PRIVATE_KEY_FASTLANE_MATCH: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
update_asana:
name: Update Asana tasks
needs: run_tests
runs-on: macos-14-xlarge
timeout-minutes: 10
steps:
- name: Check out the code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history and tags in order to extract Asana task URLs from git log
ref: ${{ github.ref_name }}
submodules: recursive
- name: Set up fastlane
run: bundle install
- name: Extract Asana Task ID
id: task-id
run: bundle exec fastlane run asana_extract_task_id task_url:"${{ github.event.inputs.asana-task-url }}"
- name: Update Asana for the release
id: update-asana
continue-on-error: true
env:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
BRANCH: ${{ github.ref_name }}
run: |
bundle exec fastlane run update_asana_for_release \
platform:macos \
release_type:internal \
github_handle:"${{ github.actor }}" \
is_scheduled_release:"${{ github.event_name == 'schedule' }}" \
release_task_id:"${{ steps.task-id.outputs.asana_task_id }}" \
target_section_id:"${{ vars.MACOS_APP_BOARD_VALIDATION_SECTION_ID }}"
prepare_release:
name: Prepare Release
needs: run_tests
uses: ./.github/workflows/release.yml
with:
asana-task-url: ${{ github.event.inputs.asana-task-url }}
destination: appstore
secrets:
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_ACCESS_KEY_ID_RELEASE_S3: ${{ secrets.AWS_ACCESS_KEY_ID_RELEASE_S3 }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY_RELEASE_S3: ${{ secrets.AWS_SECRET_ACCESS_KEY_RELEASE_S3 }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MM_HANDLES_BASE64: ${{ secrets.MM_HANDLES_BASE64 }}
MM_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}
SSH_PRIVATE_KEY_FASTLANE_MATCH: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
tag_and_merge:
name: Tag and Merge Branch
needs: [ prepare_release, update_asana ]
uses: ./.github/workflows/tag_release.yml
with:
asana-task-url: ${{ github.event.inputs.asana-task-url }}
branch: ${{ github.ref_name }}
base-branch: ${{ github.event.inputs.current-internal-release-branch || 'main' }}
prerelease: true # Pre-release for now, and the actual release will be done as part of publish_dmg_release that's called later
secrets:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
GHA_ELEVATED_PERMISSIONS_TOKEN: ${{ secrets.GHA_ELEVATED_PERMISSIONS_TOKEN }}