Skip to content

Commit

Permalink
Add templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklyp committed Sep 12, 2024
1 parent 426c752 commit ac1f9cd
Show file tree
Hide file tree
Showing 11 changed files with 298 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Generate appcast2.xml for ${TAG} hotfix release and upload assets to S3
html_notes: |
<body>
Publishing ${TAG} hotfix release failed in CI. Please follow the steps to generate the appcast file and upload files to S3 from your local machine.
Publishing ${TAG} hotfix release failed in CI. Please follow the steps to generate the appcast file and upload files to S3 from your local machine.<br>
<ol>
<li>Create a new file called <code>release-notes.txt</code> on your disk.
<ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Generate appcast2.xml for ${TAG} internal release and upload assets to S3
html_notes: |
<body>
Publishing ${TAG} internal release failed in CI. Please follow the steps to generate the appcast file and upload files to S3 from your local machine.<br>
<ol>
<li>Download <a href='${DMG_URL}'>the DMG for ${TAG} release</a>.</li>
<li>Create a new file called <code>release-notes.txt</code> on your disk.
<ul>
<li>Add each release note as a separate line and don't add bullet points (•) – the script will add them automatically.</li>
</ul></li>
<li>Run <code>appcastManager</code>:
<ul>
<li><code>./scripts/appcast_manager/appcastManager.swift --release-to-internal-channel --dmg ~/Downloads/${DMG_NAME} --release-notes release-notes.txt</code></li>
</ul></li>
<li>Verify that the new build is in the appcast file with the following internal channel tag:
<ul>
<li><code>&lt;sparkle:channel&gt;internal-channel&lt;/sparkle:channel&gt;</code></li>
</ul></li>
<li>Run <code>upload_to_s3.sh</code> script:
<ul>
<li><code>./scripts/upload_to_s3/upload_to_s3.sh --run</code></li>
</ul></li>
</ol>
When done, please verify that "Check for Updates" works correctly:
<ol>
<li>Launch a debug version of the app with an old version number.</li>
<li>Identify as an internal user in the app.</li>
<li>Go to Main Menu → DuckDuckGo → Check for Updates...</li>
<li>Verify that you're being offered to update to ${TAG}.</li>
<li>Verify that the update works.</li>
</ol><br>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Generate appcast2.xml for ${TAG} public release and upload assets to S3
html_notes: |
<body>
Publishing ${TAG} release failed in CI. Please follow the steps to generate the appcast file and upload files to S3 from your local machine.<br>
<ol>
<li>Create a new file called <code>release-notes.txt</code> on your disk.
<ul>
<li>Add each release note as a separate line and don't add bullet points (•) – the script will add them automatically.</li>
</ul></li>
<li>Run <code>appcastManager</code>:
<ul>
<li><code>./scripts/appcast_manager/appcastManager.swift --release-to-public-channel --version ${VERSION} --release-notes release-notes.txt</code></li>
</ul></li>
<li>Verify that the new build is in the appcast file with the latest release notes, the phased rollout tag (below) and no internal channel tag:
<ul>
<li><code>&lt;sparkle:phasedRolloutInterval&gt;43200&lt;/sparkle:phasedRolloutInterval&gt;</code></li>
</ul></li>
<li>Run <code>upload_to_s3.sh</code> script:
<ul>
<li><code>./scripts/upload_to_s3/upload_to_s3.sh --run --overwrite-duckduckgo-dmg ${VERSION}</code></li>
</ul></li>
</ol>
When done, please verify that "Check for Updates" works correctly:
<ol>
<li>Launch a debug version of the app with an old version number.</li>
<li>Make sure you're not identified as an internal user in the app.</li>
<li>Go to Main Menu → DuckDuckGo → Check for Updates...</li>
<li>Verify that you're being offered to update to ${TAG}.</li>
<li>Verify that the update works.</li>
</ol><br>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Delete ${BRANCH} branch
html_notes: |
<body>
The <code>${TAG}</code> public release has been successfully tagged and published in GitHub releases,
but deleting <code>${BRANCH}</code> branch failed. Please delete it manually:
<ul>
<li><code>git push origin --delete ${BRANCH}</code></li>
</ul>
Complete this task when ready, or if the release branch has already been deleted.<br>
<br>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tag ${BRANCH} branch and create GitHub release
html_notes: |
<body>
Failed to tag the release with <code>${TAG}</code> tag.<br>
Please follow instructions below to tag the branch, make GitHub release and merge release branch to <code>${BASE_BRANCH}</code> manually.<br>
<br>
Issue the following git commands to tag the release and merge the branch:
<ul>
<li><code>git fetch origin</code></li>
<li><code>git checkout ${BRANCH}</code> switch to the release branch</li>
<li><code>git pull origin ${BRANCH}</code> pull latest changes</li>
<li><code>git tag ${TAG}</code> tag the release</li>
<li><code>git push origin ${TAG}</code> push the tag</li>
<li><code>git checkout ${BASE_BRANCH}</code> switch to ${BASE_BRANCH}</li>
<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>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><br>
To create GitHub release:
<ul>
<li>Set up GH CLI if you haven't yet: <a data-asana-gid='1203791243007683'/></li>
<li>Run the following command:
<ul>
<li><code>gh release create ${TAG} --generate-notes --prerelease --notes-start-tag ${LAST_RELEASE_TAG}</code></li>
</ul></li>
</ul><br>
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.<br>
<br>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Merge ${BRANCH} to ${BASE_BRANCH}
html_notes: |
<body>
The <code>${TAG}</code> release has been successfully tagged and published in GitHub releases,
but merging to <code>${BASE_BRANCH}</code> failed. Please resolve conflicts and merge <code>${BRANCH}</code> to <code>${BASE_BRANCH}</code> manually.<br>
<br>
Issue the following git commands:
<ul>
<li><code>git fetch origin</code></li>
<li><code>git checkout ${BRANCH}</code> switch to the release branch</li>
<li><code>git pull origin ${BRANCH}</code> pull latest changes</li>
<li><code>git checkout ${BASE_BRANCH}</code> switch to ${BASE_BRANCH}</li>
<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>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>
Complete this task when ready and proceed with testing the build.<br>
<br>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tag ${BRANCH} branch, delete it, and create GitHub release
html_notes: |
<body>
Failed to tag the release with <code>${TAG}</code> tag.<br>
Please follow instructions below to tag the branch, make GitHub release and delete the release branch manually.
<ul>
<li>If the tag has already been created, please proceed with creating GitHub release and deleting the branch.</li>
<li>If both tag and GitHub release have already been created, please close this task already.</li>
</ul><br>
Issue the following git commands to tag the release and delete the branch:
<ul>
<li><code>git fetch origin</code></li>
<li><code>git checkout ${BRANCH}</code> switch to the release branch</li>
<li><code>git pull origin ${BRANCH}</code> pull latest changes</li>
<li><code>git tag ${TAG}</code> tag the release</li>
<li><code>git push origin ${TAG}</code> push the tag</li>
<li><code>git checkout ${BASE_BRANCH}</code> switch to ${BASE_BRANCH}</li>
<li><code>git push origin --delete ${BRANCH}</code> delete the release branch</li>
</ul><br>
To create GitHub release:
<ul>
<li>Set up GH CLI if you haven't yet: <a data-asana-gid='1203791243007683'/></li>
<li>Run the following command:
<ul>
<li><code>gh release create ${TAG} --generate-notes --latest --notes-start-tag ${LAST_RELEASE_TAG}</code></li>
</ul></li>
</ul><br>
Complete this task when ready.<br>
<br>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run Publish DMG Release GitHub Actions workflow
html_notes: |
<body>
<h1>Using GH CLI</h1>
Run the following command:<br>
<br>
<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><br>
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><br>
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.<br>
<br>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Move release task and included items to "Done" section in macOS App Board and close them if possible
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><br>
Complete this task when ready.<br>
<br>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Validate that 'Check For Updates' upgrades to ${TAG} for internal users
html_notes: |
<body>
<h1>Build ${TAG} has been released internally via Sparkle 🎉</h1>
Please verify that "Check for Updates" works correctly:
<ol>
<li>Launch a debug version of the app with an old version number.</li>
<li>Identify as an internal user in the app.</li>
<li>Go to Main Menu → DuckDuckGo → Check for Updates...</li>
<li>Verify that you're being offered to update to ${TAG}.</li>
<li>Verify that the update works.</li>
</ol>
<h1>🚨In case "Check for Updates" is broken</h1>
You can restore previous version of the appcast2.xml:
<ol>
<li>Download the ${OLD_APPCAST_NAME} file attached to this task.</li>
<li>Log in to AWS session:
<ul>
<li><code>aws --profile ddg-macos sso login</code></li>
</ul></li>
<li>Overwrite appcast2.xml with the old version:
<ul>
<li><code>aws --profile ddg-macos s3 cp ${OLD_APPCAST_NAME} s3://${RELEASE_BUCKET_NAME}/${RELEASE_BUCKET_PREFIX}/appcast2.xml --acl public-read</code></li>
</ul></li>
</ol><br>
<hr>
<h1>Summary of automated changes</h1>
<h2>Changes to appcast2.xml</h2>
See the attached <em>${APPCAST_PATCH_NAME}</em> file.
<h2>Release notes</h2>
See the attached <em>${RELEASE_NOTES_FILE}</em> file for release notes extracted automatically from <a data-asana-gid='${RELEASE_TASK_ID}' data-asana-dynamic='false'>the release task</a> description.
<h2>List of files uploaded to S3</h2>
<ol>
${FILES_UPLOADED}
</ol><br>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Validate that 'Check For Updates' upgrades to ${TAG}
html_notes: |
<body>
<h1>Build ${TAG} has been released publicly via Sparkle 🎉</h1>
Please verify that "Check for Updates" works correctly:
<ol>
<li>Launch a debug version of the app with an old version number.</li>
<li>Make sure you're not identified as an internal user in the app.</li>
<li>Go to Main Menu → DuckDuckGo → Check for Updates...</li>
<li>Verify that you're being offered to update to ${TAG}.</li>
<li>Verify that the update works.</li>
</ol>
<h1>🚨In case "Check for Updates" is broken</h1>
You can restore previous version of the appcast2.xml:
<ol>
<li>Download the ${OLD_APPCAST_NAME} file attached to this task.</li>
<li>Log in to AWS session:
<ul>
<li><code>aws --profile ddg-macos sso login</code></li>
</ul></li>
<li>Overwrite appcast2.xml with the old version:
<ul>
<li><code>aws --profile ddg-macos s3 cp ${OLD_APPCAST_NAME} s3://${RELEASE_BUCKET_NAME}/${RELEASE_BUCKET_PREFIX}/appcast2.xml --acl public-read</code></li>
</ul></li>
</ol><br>
<hr>
<h1>Summary of automated changes</h1>
<h2>Changes to appcast2.xml</h2>
See the attached <em>${APPCAST_PATCH_NAME}</em> file.
<h2>Release notes</h2>
See the attached <em>${RELEASE_NOTES_FILE}</em> file for release notes extracted automatically from <a data-asana-gid='${RELEASE_TASK_ID}' data-asana-dynamic='false'>the release task</a> description.
<h2>List of files uploaded to S3</h2>
<ol>
${FILES_UPLOADED}
</ol><br>
🔗 Workflow URL: <a href='${WORKFLOW_URL}'>${WORKFLOW_URL}</a>.
</body>

0 comments on commit ac1f9cd

Please sign in to comment.