Skip to content

Commit

Permalink
Add action item about making a DMG release
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Mar 4, 2024
1 parent 91a651a commit e61f137
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/actions/asana-create-action-item/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ runs:
shell: bash
env:
ASSIGNEE_ID: ${{ steps.get-automation-subtask.outputs.assignee-id }}
AUTOMATION_TASK_ID: ${{ steps.get-automation-subtask.outputs.automation-task-id }}
TEMPLATE_PATH: ${{ github.action_path }}/templates/${{ inputs.template-name }}.yml
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
if [ ! -f $TEMPLATE_PATH ]; then
echo "::error::Template file not found at $TEMPLATE_PATH"
Expand All @@ -64,6 +66,7 @@ runs:
shell: bash
env:
ASSIGNEE_ID: ${{ steps.get-automation-subtask.outputs.assignee-id }}
AUTOMATION_TASK_ID: ${{ steps.get-automation-subtask.outputs.automation-task-id }}
NOTES: ${{ inputs.notes }}
TASK_NAME: ${{ inputs.task-name }}
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Expand All @@ -76,6 +79,7 @@ runs:
shell: bash
env:
ASSIGNEE_ID: ${{ steps.get-automation-subtask.outputs.assignee-id }}
AUTOMATION_TASK_ID: ${{ steps.get-automation-subtask.outputs.automation-task-id }}
HTML_NOTES: ${{ inputs.html-notes }}
TASK_NAME: ${{ inputs.task-name }}
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ data:
</ul></li>
<li><code>git push origin ${BASE_BRANCH}</code> push merged branch</li>
</ul>
Complete this task when ready and proceed with testing the build.
Complete this task when ready and proceed with testing the build. If you're bumping an internal release, you should get another task asking you to publish the release in Sparkle.
Look for other tasks in <a data-asana-gid='${AUTOMATION_TASK_ID}'/> task and handle them as needed.
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
data:
name: Run Publish DMG Release GitHub Actions workflow
assignee: "${ASSIGNEE_ID}"
html_notes: |
<body>
<h1>Using GH CLI</h1>
Run the following command:
<code>gh workflow run publish_dmg_release.yml --ref ${BRANCH} -f asana-task-url=${ASANA_TASK_URL} -f tag=${TAG} -f release-type=internal</code>
<h1>Using GitHub web UI</h1>
<ol>
<li>Open <a href='https://github.com/duckduckgo/macos-browser/actions/workflows/publish_dmg_release.yml'>Publish DMG Release workflow page</a>.</li>
<li>Click "Run Workflow" and fill in the form as follows:
<ul>
<li><b>Branch</b> <code>${BRANCH}</code></li>
<li><b>Asana release task URL</b> <code>${ASANA_TASK_URL}</code></li>
<li><b>Tag to publish</b> <code>${TAG}</code></li>
<li><b>Release Type</b> <code>internal</code></li>
</ul></li>
</ol>
The GitHub Action workflow does the following:
<ul>
<li>Fetches the release DMG from staticcdn.duckduckgo.com</li>
<li>Extracts release notes from the Asana task description</li>
<li>Runs <code>appcastManager</code> to generate the new appcast2.xml file</li>
<li>Stores the diff against previous version and the copy of the old appcast2.xml file</li>
<li>Uploads new appcast, DMG and binary delta files to S3</li>
<li>On success, creates a task for the release DRI to validate that "Check for Updates" works, with instructions on how to revert that change if "Check for Updates" is broken.</li>
<li>On failure, creates a task for the release DRI with manual instructions on generating the appcast and uploading to S3.</li>
</ul>
Complete this task when ready and proceed with testing the build. If GitHub Actions is unavailable, you'll find manual instructions in the <em>Run Publish DMG Release GitHub Actions workflow</em> subtask of <em>Make Internal Release</em> task.
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
1 change: 1 addition & 0 deletions .github/workflows/bump_internal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ jobs:
branch: ${{ github.ref_name }}
base-branch: ${{ github.event.inputs.base-branch || 'main' }}
prerelease: true
internal-release-bump: true
secrets:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
GHA_ELEVATED_PERMISSIONS_TOKEN: ${{ secrets.GHA_ELEVATED_PERMISSIONS_TOKEN }}
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ on:
description: "Is this a pre-release? (a.k.a. internal release)"
required: true
type: boolean
internal-release-bump:
description: "Is this an internal release bump? (the subsequent internal release of the current week)"
required: false
default: false
type: boolean
secrets:
ASANA_ACCESS_TOKEN:
required: true
Expand All @@ -57,6 +62,7 @@ jobs:
BASE_BRANCH: ${{ inputs.base-branch || 'main' }}
BRANCH: ${{ inputs.branch || github.ref_name }}
prerelease: ${{ github.event.inputs.prerelease || inputs.prerelease }}
internal-release-bump: ${{ inputs.internal-release-bump }}

outputs:
tag: ${{ steps.create-tag.outputs.tag }}
Expand Down Expand Up @@ -150,6 +156,9 @@ jobs:
if [[ "${prerelease}" == "true" ]]; then
echo "task-template=merge-failed" >> $GITHUB_OUTPUT
echo "comment-template=internal-release-ready-merge-failed" >> $GITHUB_OUTPUT
if [[ "${internal-release-bump}" == "true" ]]; then
echo "extra-task-template=run-publish-dmg-release" >> $GITHUB_OUTPUT
fi
else
echo "task-template=delete-branch-failed" >> $GITHUB_OUTPUT
echo "comment-template=public-release-tagged-delete-branch-failed" >> $GITHUB_OUTPUT
Expand All @@ -158,6 +167,9 @@ jobs:
if [[ "${prerelease}" == "true" ]]; then
echo "task-template=internal-release-tag-failed" >> $GITHUB_OUTPUT
echo "comment-template=internal-release-ready-tag-failed" >> $GITHUB_OUTPUT
if [[ "${internal-release-bump}" == "true" ]]; then
echo "extra-task-template=run-publish-dmg-release" >> $GITHUB_OUTPUT
fi
else
echo "task-template=public-release-tag-failed" >> $GITHUB_OUTPUT
echo "comment-template=public-release-tag-failed" >> $GITHUB_OUTPUT
Expand All @@ -173,6 +185,17 @@ jobs:
release-task-url: ${{ env.asana-task-url }}
template-name: ${{ steps.asana-failure-templates.outputs.task-template }}

- name: Create Publish DMG Release task on failure
id: create-publish-dmg-task-on-failure
if: (failure() || env.MERGE_OR_DELETE_FAILED == 'true') && env.internal-release-bump == 'true'
uses: ./.github/actions/asana-create-action-item
env:
ASANA_TASK_URL: ${{ env.asana-task-url }}
with:
access-token: ${{ secrets.ASANA_ACCESS_TOKEN }}
release-task-url: ${{ env.asana-task-url }}
template-name: ${{ steps.asana-failure-templates.outputs.extra-task-template }}

- name: Report failure
if: failure() || env.MERGE_OR_DELETE_FAILED == 'true'
uses: ./.github/actions/asana-log-message
Expand Down

0 comments on commit e61f137

Please sign in to comment.