Set Up Hotfix Release Branch #45
Workflow file for this run
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: 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: | |
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: | | |
last_release="$(gh api repos/${{ github.repository }}/releases/latest | jq -r .tag_name)" | |
echo "last_release=$last_release" >> $GITHUB_OUTPUT | |
bundle exec fastlane run start_new_release \ | |
platform:"macos" \ | |
version:"$last_release" \ | |
github_handle:"${{ github.actor }}" \ | |
is_hotfix:"true" | |
- 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.create_release_task.outputs.asana_task_url }}" \ | |
template_name:"hotfix-branch-ready" |