Skip to content

Commit

Permalink
Merge branch 'release/ios/7.154.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
kshann committed Jan 27, 2025
2 parents 1ce723c + 1ee29bc commit 87bbd35
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 4 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/ios-build-hotfix-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: iOS - 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/ios-pr-checks.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:ios \
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.IOS_APP_BOARD_VALIDATION_SECTION_ID }}"
prepare_release:
name: Prepare Release
needs: run_tests
uses: ./.github/workflows/ios-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_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
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/ios-tag-release-update-asana.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' }}
release-type: internal # Pre-release for now, after submitting to app store we will run ios-tag-release-update-asana again manually with 'hotfix' release type to finish up
secrets:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
GHA_ELEVATED_PERMISSIONS_TOKEN: ${{ secrets.GHA_ELEVATED_PERMISSIONS_TOKEN }}
66 changes: 66 additions & 0 deletions .github/workflows/ios-hotfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: iOS - Set Up Hotfix Release Branch

on:
workflow_dispatch:

jobs:

create_release_branch:

name: Create Release Branch

runs-on: macos-15-xlarge
timeout-minutes: 10

outputs:
release_branch_name: ${{ steps.make_release_branch.outputs.release_branch_name }}
asana_task_url: ${{ steps.create_release_task.outputs.asana_task_url }}

steps:

- name: Assert main branch
run: |
if [ "${{ github.ref_name }}" != "main" ]; then
echo "👎 Not the main branch"
exit 1
fi
- name: Check out the code
uses: actions/checkout@v4
with:
token: ${{ secrets.GHA_ELEVATED_PERMISSIONS_TOKEN }}
submodules: recursive
fetch-depth: 0 # Fetch all history and tags in order to extract Asana task URLs from git log

- name: Set up fastlane
run: bundle install

- name: Make release branch
id: make_release_branch
env:
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 }}
# Elevated permissions token is needed here to use GH git/refs API (used by fastlane)
GITHUB_TOKEN: ${{ secrets.GHA_ELEVATED_PERMISSIONS_TOKEN }}
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
run: |
bundle exec fastlane run start_new_release \
platform:"ios" \
github_handle:"${{ github.actor }}" \
is_hotfix:"true"
# Necessary as make_release_branch will checkout a hotfix branch and the plugins may be differnet
- name: Reinstall fastlane
run: bundle install

- name: Report success
env:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
BRANCH: ${{ steps.make_release_branch.outputs.release_branch_name }}
RELEASE_TAG: ${{ steps.make_release_branch.outputs.last_release }}
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
bundle exec fastlane run asana_add_comment \
task_url:"${{ steps.make_release_branch.outputs.asana_task_url }}" \
template_name:"hotfix-branch-ready"
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/duckduckgo/fastlane-plugin-ddg_apple_automation
revision: 8d13f1e78e69886345f92dc575c6063b76d1da25
tag: 1.0.1
revision: 50fcf1406577111daaa40841c23d9ba68adc2fe3
tag: 1.0.2
specs:
fastlane-plugin-ddg_apple_automation (1.0.1)
fastlane-plugin-ddg_apple_automation (1.0.2)
asana
climate_control
httpparty
Expand Down
2 changes: 1 addition & 1 deletion fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-ddg_apple_automation', git: 'https://github.com/duckduckgo/fastlane-plugin-ddg_apple_automation', tag: '1.0.1'
gem 'fastlane-plugin-ddg_apple_automation', git: 'https://github.com/duckduckgo/fastlane-plugin-ddg_apple_automation', tag: '1.0.2'

0 comments on commit 87bbd35

Please sign in to comment.