-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add GHA workflow to cut release branch #1976
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4b5d484
Add code_freeze.yml
ayoy fde0287
Disable flaky unit test
ayoy 56a9c2e
Update upload/download artifact to v4
ayoy c9cbed4
Create release task in Asana
ayoy 7a5723a
Re-enable main branch check
ayoy 2f49b0a
Revert "Disable flaky unit test"
ayoy b34558f
Merge branch 'main' into dominik/gha-cut-release-branch
ayoy a26b37c
Restore default branch check in Fastfile
ayoy f1916ad
Update Fastlane readme
ayoy 7ee8fa2
Merge branch 'main' into dominik/gha-cut-release-branch
ayoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
name: Code Freeze | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
create_release_branch: | ||
|
||
name: Create Release Branch | ||
|
||
runs-on: macos-13-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@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Prepare 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 }} | ||
run: | | ||
git config --global user.name "Dax the Duck" | ||
git config --global user.email "[email protected]" | ||
bundle exec fastlane make_release_branch | ||
|
||
- name: Create release task | ||
id: create_release_task | ||
env: | ||
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} | ||
run: | | ||
version="$(echo ${{ steps.make_release_branch.outputs.release_branch_name }} | cut -d '/' -f 2)" | ||
task_name="macOS App Release $version" | ||
asana_task_id="$(curl -fLSs -X POST "https://app.asana.com/api/1.0/task_templates/${{ vars.MACOS_RELEASE_TASK_TEMPLATE_ID }}/instantiateTask" \ | ||
-H "Authorization: Bearer ${{ env.ASANA_ACCESS_TOKEN }}" \ | ||
-H "Content-Type: application/json" \ | ||
-d "{ \"data\": { \"name\": \"$task_name\" }}" \ | ||
| jq -r .data.new_task.gid)" | ||
echo "asana_task_url=https://app.asana.com/0/0/${asana_task_id}/f" >> $GITHUB_OUTPUT | ||
|
||
assignee_id="$(curl -fLSs https://raw.githubusercontent.com/duckduckgo/BrowserServicesKit/main/.github/actions/asana-failed-pr-checks/user_ids.json \ | ||
| jq -r .${{ github.actor }})" | ||
|
||
curl -fLSs -X PUT "https://app.asana.com/api/1.0/tasks/${asana_task_id}" \ | ||
-H "Authorization: Bearer ${{ env.ASANA_ACCESS_TOKEN }}" \ | ||
-H "Content-Type: application/json" \ | ||
--output /dev/null \ | ||
-d "{ \"data\": { \"assignee\": \"$assignee_id\" }}" | ||
|
||
run_tests: | ||
|
||
name: Run Tests | ||
|
||
needs: create_release_branch | ||
uses: ./.github/workflows/pr.yml | ||
with: | ||
branch: ${{ needs.create_release_branch.outputs.release_branch_name }} | ||
secrets: | ||
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} | ||
|
||
increment_build_number: | ||
|
||
name: Increment Build Number | ||
|
||
needs: [ create_release_branch, run_tests ] | ||
runs-on: macos-13-xlarge | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
|
||
- name: Check out the code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
ref: ${{ needs.create_release_branch.outputs.release_branch_name }} | ||
|
||
- name: Prepare fastlane | ||
run: bundle install | ||
|
||
- name: Increment build number | ||
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 }} | ||
run: | | ||
git config --global user.name "Dax the Duck" | ||
git config --global user.email "[email protected]" | ||
bundle exec fastlane bump_internal_release update_embedded_files:false | ||
|
||
prepare_release: | ||
name: Prepare Release | ||
needs: [ create_release_branch, increment_build_number ] | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
asana-task-url: ${{ needs.create_release_branch.outputs.asana_task_url }} | ||
branch: ${{ needs.create_release_branch.outputs.release_branch_name }} | ||
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_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | ||
SSH_PRIVATE_KEY_FASTLANE_MATCH: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }} |
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From this place to the end of the file it's 1:1 the same as (already reviewed) bump_internal_release.yml. Yes, we could unify it, but I'll save it for later.