Skip to content

Commit

Permalink
Merge branch 'main' into sabrina/localise_app
Browse files Browse the repository at this point in the history
  • Loading branch information
SabrinaTardio authored Mar 4, 2024
2 parents 12dd9d1 + 0dfdac7 commit 707a696
Show file tree
Hide file tree
Showing 157 changed files with 2,890 additions and 1,442 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
data:
# yq -o=j | sed -E 's/\\n( *)([^\\n])/\2/g'
html_text: |
<body>
<h2>Hotfix branch ${BRANCH} ready ⚙️</h2>
<ul>
<li>🔱 <code>${BRANCH}</code> branch has been created off <code>${RELEASE_TAG}</code> tag.</li>
<li>Point any pull requests with changes required for the hotfix release to that branch.</li>
</ul>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ data:
<h2>Build ${TAG} is available publicly through Sparkle 🚀</h2>
<ul>
<li>🌟 New appcast file has been generated and uploaded to S3, together with binary delta files.</li>
<li>👀 <a data-asana-gid='${ASSIGNEE_ID}'/>, please proceed by following instructions in <a data-asana-gid='${TASK_ID}'/> which concludes the release process.</li>
<li>👀 <a data-asana-gid='${ASSIGNEE_ID}'/>, please proceed by following instructions in <a data-asana-gid='${TASK_ID}'/> and <a data-asana-gid='${ANNOUNCEMENT_TASK_ID}'/> which concludes the release process.</li>
</ul>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
Expand Down
30 changes: 23 additions & 7 deletions .github/actions/asana-create-action-item/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ inputs:
description: "Task name"
required: false
type: string
contents:
description: "Task contents"
notes:
description: "Task notes"
required: false
type: string
html-notes:
description: "Task HTML notes"
required: false
type: string
template-name:
Expand Down Expand Up @@ -55,16 +59,28 @@ runs:
payload="$(envsubst < $TEMPLATE_PATH | yq -o=j | sed -E 's/\\n( *)([^\\n])/\2/g' | jq -c)"
echo "payload-base64=$(base64 <<< $payload)" >> $GITHUB_OUTPUT
- id: process-contents-payload
if: ${{ inputs.contents }}
- id: process-notes-payload
if: ${{ inputs.notes }}
shell: bash
env:
ASSIGNEE_ID: ${{ steps.get-automation-subtask.outputs.assignee-id }}
NOTES: ${{ inputs.notes }}
TASK_NAME: ${{ inputs.task-name }}
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
payload="{ \"data\": { \"name\": \"${TASK_NAME}\", \"notes\": \"${NOTES}\n\n🔗 Workflow URL: ${WORKFLOW_URL}\", \"assignee\": \"${ASSIGNEE_ID}\" } }"
echo "payload-base64=$(base64 <<< $payload)" >> $GITHUB_OUTPUT
- id: process-html-notes-payload
if: ${{ inputs.html-notes }}
shell: bash
env:
ASSIGNEE_ID: ${{ steps.get-automation-subtask.outputs.assignee-id }}
CONTENTS: ${{ inputs.contents }}
HTML_NOTES: ${{ inputs.html-notes }}
TASK_NAME: ${{ inputs.task-name }}
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
payload="{ \"data\": { \"name\": \"${TASK_NAME}\", \"notes\": \"${CONTENTS}\n\nWorkflow URL: ${WORKFLOW_URL}\", \"assignee\": \"${ASSIGNEE_ID}\" } }"
payload="{ \"data\": { \"name\": \"${TASK_NAME}\", \"html_notes\": \"${HTML_NOTES}\", \"assignee\": \"${ASSIGNEE_ID}\" } }"
echo "payload-base64=$(base64 <<< $payload)" >> $GITHUB_OUTPUT
- id: create-task
Expand All @@ -73,7 +89,7 @@ runs:
ASANA_ACCESS_TOKEN: ${{ inputs.access-token }}
ASSIGNEE_ID: ${{ steps.get-automation-subtask.outputs.assignee-id }}
TASK_ID: ${{ steps.get-automation-subtask.outputs.automation-task-id }}
PAYLOAD_BASE64: ${{ steps.process-template-payload.outputs.payload-base64 || steps.process-comment-payload.outputs.payload-base64 }}
PAYLOAD_BASE64: ${{ steps.process-template-payload.outputs.payload-base64 || steps.process-notes-payload.outputs.payload-base64 || steps.process-html-notes-payload.outputs.payload-base64 }}
run: |
# Create a subtask and retrieve its ID from the response (.data.gid) to return as an output
new_task_id=$(set -o pipefail && curl -fLSs "https://app.asana.com/api/1.0/tasks/${TASK_ID}/subtasks?opt_fields=gid" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ data:
<li><code>git pull origin ${BASE_BRANCH}</code> pull the latest code</li>
<li><code>git merge ${BRANCH}</code>
<ul>
<li>resolve conflicts as needed</li>
<li>Resolve conflicts as needed</li>
<li>When merging a hotfix branch into an internal release branch, you will get conflicts in version and build number xcconfig files:
<ul>
<li>In the version file: accept the internal version number (higher).</li>
<li>In the build number file: accept the hotfix build number (higher). This step is very important in order to calculate the build number of the next internal release correctly.</li>
</ul></li>
</ul></li>
<li><code>git push origin ${BASE_BRANCH}</code> push merged branch</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ data:
<li><code>git pull origin ${BASE_BRANCH}</code> pull the latest code</li>
<li><code>git merge ${BRANCH}</code>
<ul>
<li>resolve conflicts as needed</li>
<li>Resolve conflicts as needed</li>
<li>When merging a hotfix branch into an internal release branch, you will get conflicts in version and build number xcconfig files:
<ul>
<li>In the version file: accept the internal version number (higher).</li>
<li>In the build number file: accept the hotfix build number (higher). This step is very important in order to calculate the build number of the next internal release correctly.</li>
</ul></li>
</ul></li>
<li><code>git push origin ${BASE_BRANCH}</code> push merged branch</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
data:
name: Move release task and included items to "Done" section in macOS App Board and close them if possible
assignee: "${ASSIGNEE_ID}"
html_notes: |
<body>
Automation failed to update Asana for the public release. Please follow the steps below.
<ol>
<li>Open <a data-asana-gid='${APP_BOARD_ASANA_PROJECT_ID}'/> and select the List view</li>
<li>Scroll to the "Validation" section.</li>
<li>Select all the tasks in that section.</li>
<li>Drag and drop all the selected tasks to the "Done" section</li>
<li>Close all tasks that are not incidents and don't belong to <a data-asana-gid='72649045549333'/> project, including the release task itself.</li>
</ol>
Complete this task when ready.
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
124 changes: 124 additions & 0 deletions .github/workflows/build_hotfix_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
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:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}

update_asana:

name: Update Asana tasks

needs: run_tests
runs-on: macos-13-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: Extract Asana Task ID
id: task-id
uses: ./.github/actions/asana-extract-task-id
with:
task-url: ${{ github.event.inputs.asana-task-url }}

- name: Update Asana tasks for the release
env:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
GH_TOKEN: ${{ github.token }}
BRANCH: ${{ github.ref_name }}
run: |
version="$(cut -d '/' -f 2 <<< "$BRANCH")"
# 'internal', because we start with making a build that still needs to be tested before being published
# and we want Asana tasks to be moved to "Validation" and not already to "Done"
./scripts/update_asana_for_release.sh internal ${{ steps.task-id.outputs.task-id }} ${{ vars.MACOS_APP_BOARD_VALIDATION_SECTION_ID }} "${version}"
prepare_release:
name: Prepare Release
needs: run_tests
uses: ./.github/workflows/release.yml
with:
asana-task-url: ${{ github.event.inputs.asana-task-url }}
secrets:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
REVIEW_PROVISION_PROFILE_BASE64: ${{ secrets.REVIEW_PROVISION_PROFILE_BASE64 }}
RELEASE_PROVISION_PROFILE_BASE64: ${{ secrets.RELEASE_PROVISION_PROFILE_BASE64 }}
DBP_AGENT_RELEASE_PROVISION_PROFILE_BASE64: ${{ secrets.DBP_AGENT_RELEASE_PROVISION_PROFILE_BASE64 }}
DBP_AGENT_REVIEW_PROVISION_PROFILE_BASE64: ${{ secrets.DBP_AGENT_REVIEW_PROVISION_PROFILE_BASE64 }}
NETP_SYSEX_RELEASE_PROVISION_PROFILE_BASE64_V2: ${{ secrets.NETP_SYSEX_RELEASE_PROVISION_PROFILE_BASE64_V2 }}
NETP_SYSEX_REVIEW_PROVISION_PROFILE_BASE64_V2: ${{ secrets.NETP_SYSEX_REVIEW_PROVISION_PROFILE_BASE64_V2 }}
NETP_AGENT_RELEASE_PROVISION_PROFILE_BASE64_V2: ${{ secrets.NETP_AGENT_RELEASE_PROVISION_PROFILE_BASE64_V2 }}
NETP_AGENT_REVIEW_PROVISION_PROFILE_BASE64_V2: ${{ secrets.NETP_AGENT_REVIEW_PROVISION_PROFILE_BASE64_V2 }}
NETP_NOTIFICATIONS_RELEASE_PROVISION_PROFILE_BASE64: ${{ secrets.NETP_NOTIFICATIONS_RELEASE_PROVISION_PROFILE_BASE64 }}
NETP_NOTIFICATIONS_REVIEW_PROVISION_PROFILE_BASE64: ${{ secrets.NETP_NOTIFICATIONS_REVIEW_PROVISION_PROFILE_BASE64 }}
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 }}
MM_HANDLES_BASE64: ${{ secrets.MM_HANDLES_BASE64 }}
MM_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}
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 }}
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/bump_internal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
BRANCH: ${{ github.ref_name }}
run: |
version="$(cut -d '/' -f 2 <<< "$BRANCH")"
./scripts/update_asana_for_release.sh ${{ steps.task-id.outputs.task-id }} "${version}" ${{ vars.MACOS_APP_BOARD_VALIDATION_SECTION_ID }}
./scripts/update_asana_for_release.sh internal ${{ steps.task-id.outputs.task-id }} ${{ vars.MACOS_APP_BOARD_VALIDATION_SECTION_ID }} "${version}"
prepare_release:
name: Prepare Release
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/code_freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
./scripts/update_asana_for_release.sh \
internal \
${{ steps.create_release_task.outputs.asana_task_id }} \
${{ steps.create_release_task.outputs.marketing_version }} \
${{ vars.MACOS_APP_BOARD_VALIDATION_SECTION_ID }}
${{ vars.MACOS_APP_BOARD_VALIDATION_SECTION_ID }} \
${{ steps.create_release_task.outputs.marketing_version }}
run_tests:

Expand Down
Loading

0 comments on commit 707a696

Please sign in to comment.