Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish subsequent internal releases right after building #2306

Merged
merged 19 commits into from
Mar 4, 2024

Conversation

ayoy
Copy link
Collaborator

@ayoy ayoy commented Mar 4, 2024

Task/Issue URL: https://app.asana.com/0/0/1206676349038948/f
CC: @loremattei

Description:
This change combines Bump Internal Release and Publish DMG Release workflows in that the former
calls the latter. As a result, bumping internal release is a single workflow run.

Steps to test this PR:
Check out the following places:

  • Code Freeze workflow run for a test release, that worked well as it should, because it shouldn't get affected by the changes.
  • Bump Internal Release workflow run for a test release, that builds the app, tags and merges the branch, and publishes the app to Sparkle (this time it failed because I messed up the appcast file server-side).
  • Fully successful Bump Internal Release workflow run.
  • Bump Internal Release workflow run that failed to merge the release branch because of a conflict (introduced deliberately). It created Merge release/0.74.0 to dominik/test-base-branch and proceeded with the release (the tag is created, only merging failed).
  • When Bump Internal Release fails to create a tag and/or GitHub Release, it posts a similar Merge task, but also another one: Run Publish DMG Release GitHub Actions workflow. Merge task instructs the release DRI to look for other subtasks in the Automation task at the end of the description.
  • Updated Asana automation comment that is posted after tagging the release, saying that the Sparkle release will be done automatically.

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@ayoy ayoy requested a review from jaceklyp March 4, 2024 13:26
<li>📥 DMG is available from <a href='${DMG_URL}'>${DMG_URL}</a>.</li>
<li>📥 DMG is available from <a href='${DMG_URL}'>${DMG_URL}</a>.
<ul>
<li>If this is a subsequent internal release (started by calling <em>Bump Internal Release</em> workflow), the DMG will be automatically published to Sparkle in a few minutes. Sit tight.</li>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is lame - it should be a separate template, but I didn't have time for it now.

Comment on lines +16 to +19
<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>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parametrized instructions on how to set up a workflow run 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these deleted files were not in use (they were copied over to another directory some time ago and not deleted from here).

Comment on lines +137 to +148
publish_release:
name: Publish DMG Release
needs: [ tag_and_merge ]
uses: ./.github/workflows/publish_dmg_release.yml
with:
asana-task-url: ${{ github.event.inputs.asana-task-url }}
secrets:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
AWS_ACCESS_KEY_ID_RELEASE_S3: ${{ secrets.AWS_ACCESS_KEY_ID_RELEASE_S3 }}
AWS_SECRET_ACCESS_KEY_RELEASE_S3: ${{ secrets.AWS_SECRET_ACCESS_KEY_RELEASE_S3 }}
GHA_ELEVATED_PERMISSIONS_TOKEN: ${{ secrets.GHA_ELEVATED_PERMISSIONS_TOKEN }}
SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }}
Copy link
Collaborator Author

@ayoy ayoy Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change here :) every subsequent internal release is automatically published to Sparkle internal channel.

@@ -163,6 +179,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.internal-release-bump == 'true'
Copy link
Collaborator Author

@ayoy ayoy Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only want this (break the workflow and ask release DRI to publish manually) on a proper failure (failure()). This workflow does not treat merge conflict as failure so it moves on, and since merge conflict is not a blocker for releasing the build (that's already made and tagged in git after all), it gets published automatically on internal release bumps, and the release DRI needs to handle merging separately.

@@ -43,6 +61,10 @@ jobs:

name: Publish a release to Sparkle

env:
RELEASE_TYPE: ${{ github.event.inputs.release-type || 'internal' }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RELEASE_TYPE is used in a few places in this workflow so I extracted it to the job-level env.

Copy link
Contributor

@jaceklyp jaceklyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@ayoy ayoy merged commit 676528e into main Mar 4, 2024
17 checks passed
@ayoy ayoy deleted the dominik/bump-internal-ng branch March 4, 2024 16:26
samsymons added a commit that referenced this pull request Mar 6, 2024
# By Alexey Martemyanov (10) and others
# Via GitHub
* main: (39 commits)
  Add Peoplewhiz data broker (#2310)
  Integrate confirm entitlements endpoint for macOS App Store purchase (#2325)
  Make dbSaveBloomFilterError pixel daily and continuous (#2299)
  Subscription UI updates (#2303)
  Add email pattern on opt-out pixel (#2307)
  Use compile-time checked generated asset names (#2177)
  fix bundle name in breakByRaisingSigInt (#2319)
  BSK update for iOS autofill support to delete all passwords (#2254)
  Bump BrowserServicesKit (#2309)
  Bump version to 1.78.0 (132)
  Fix crash on popup window display; adjust naming (#2315)
  Bump version to 1.78.0 (131)
  Set marketing version to 1.78.0
  Update embedded files
  Fix parsing commit log (#2311)
  DBP: Set correct duration of submit-success pixel (#2308)
  Publish subsequent internal releases right after building (#2306)
  DBP disable pixel changes (#2293)
  Remove duplicated broker items (#2294)
  fix tab title not updated (#2302)
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants