Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into alex/hide-continue-se…
Browse files Browse the repository at this point in the history
…tup-cards
  • Loading branch information
mallexxx committed Nov 20, 2024
2 parents 7c6e8b8 + 9587487 commit 167dc90
Show file tree
Hide file tree
Showing 107 changed files with 2,174 additions and 489 deletions.
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ CC:

**Description**:

**Optional E2E tests**:
- [ ] Run PIR E2E tests
Check this to run the Personal Information Removal end to end tests. If updating CCF, or any PIR related code, tick this.

**Steps to test this PR**:
1.

Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/build_appstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,17 @@ jobs:
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: |
if [ "${{ env.destination }}" == "testflight_review" ]; then
app_bundle_name="DuckDuckGo App Store Review"
app_dsym_name="DuckDuckGo-AppStore-Review"
else
app_bundle_name="DuckDuckGo App Store"
app_dsym_name="DuckDuckGo-AppStore"
fi
bundle exec fastlane release_${{ env.destination }}
dsym_path="${{ github.workspace }}/DuckDuckGo-AppStore.app.dSYM.zip"
mv -f "${{ github.workspace }}/DuckDuckGo App Store.app.dSYM.zip" "${dsym_path}"
dsym_path="${{ github.workspace }}/${app_dsym_name}.app.dSYM.zip"
mv -f "${{ github.workspace }}/${app_bundle_name}.app.dSYM.zip" "${dsym_path}"
version="$(cut -d ' ' -f 3 < Configuration/Version.xcconfig)"
build_number="$(cut -d ' ' -f 3 < Configuration/BuildNumber.xcconfig)"
echo "dsym-path=${dsym_path}" >> $GITHUB_ENV
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/build_notarized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ on:
description: "Branch name"
required: false
type: string
skip-notify:
description: "Skip Mattermost notification"
required: false
default: false
type: boolean
secrets:
APPLE_API_KEY_BASE64:
required: true
Expand Down Expand Up @@ -71,7 +76,7 @@ jobs:

name: Export Notarized App

runs-on: macos-14-xlarge
runs-on: macos-15-xlarge

outputs:
app-version: ${{ steps.set-outputs.outputs.app-version }}
Expand Down Expand Up @@ -230,7 +235,7 @@ jobs:
needs: export-notarized-app
if: ${{ github.event.inputs.create-dmg == true || inputs.create-dmg == true }}

runs-on: macos-14
runs-on: macos-15

env:
app-version: ${{ needs.export-notarized-app.outputs.app-version }}
Expand Down Expand Up @@ -360,7 +365,7 @@ jobs:
name: Send Mattermost message

needs: [export-notarized-app, create-dmg]
if: always()
if: ${{ always() && inputs.skip-notify == false }}

runs-on: ubuntu-latest

Expand Down
116 changes: 21 additions & 95 deletions .github/workflows/bump_internal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ jobs:

# This doesn't need Xcode, so could technically run on Ubuntu, but find_asana_release_task.sh
# uses BSD-specific `date` syntax, that doesn't work with GNU `date` (available on Linux).
runs-on: macos-14
runs-on: macos-15
timeout-minutes: 10

outputs:
skip-release: ${{ steps.check-for-changes.outputs.skip-release }}
asana-task-url: ${{ steps.set-parameters.outputs.asana-task-url }}
release-branch: ${{ steps.set-parameters.outputs.release-branch }}
skip-appstore: ${{ steps.set-parameters.outputs.skip-appstore }}
skip-release: ${{ steps.prepare-release-bump.outputs.skip_release }}
asana-task-id: ${{ steps.prepare-release-bump.outputs.release_task_id }}
asana-task-url: ${{ steps.prepare-release-bump.outputs.release_task_url }}
release-branch: ${{ steps.prepare-release-bump.outputs.release_branch }}
skip-appstore: ${{ steps.prepare-release-bump.outputs.skip_appstore }}

steps:

Expand All @@ -53,88 +54,24 @@ jobs:
- name: Set up fastlane
run: bundle install

# When running on schedule there are no inputs, so the workflow has to find the Asana task
- name: Find Asana release task
id: find-asana-task
if: github.event.inputs.asana-task-url == null
- name: Prepare release bump
id: prepare-release-bump
env:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
run: |
bundle exec fastlane run asana_find_release_task platform:macos
# When running on schedule, only proceed if there are changes to the release branch (i.e. HEAD is not tagged)
- name: Check if there are changes to the release branch
id: check-for-changes
env:
release_branch: ${{ steps.find-asana-task.outputs.release_branch || github.ref_name }}
run: |
if [[ "${{ github.event_name }}" != "schedule" ]]; then
echo "skip-release=false" >> $GITHUB_OUTPUT
else
latest_tag="$(git describe --tags --abbrev=0)"
latest_tag_sha="$(git rev-parse "$latest_tag"^{})"
release_branch_sha="$(git rev-parse "origin/${release_branch}")"
if [[ "${latest_tag_sha}" == "${release_branch_sha}" ]]; then
echo "::warning::Release branch's HEAD is already tagged. Skipping automatic release."
echo "skip-release=true" >> $GITHUB_OUTPUT
else
changed_files="$(git diff --name-only "$latest_tag".."origin/${release_branch}")"
if grep -q -v -e '.github' -e 'scripts' <<< "$changed_files"; then
echo "::warning::New code changes found in the release branch since the last release. Will bump internal release now."
echo "skip-release=false" >> $GITHUB_OUTPUT
else
echo "::warning::No changes to the release branch (or only changes to scripts and workflows). Skipping automatic release."
echo "skip-release=true" >> $GITHUB_OUTPUT
fi
fi
fi
- name: Extract Asana Task ID
id: task-id
if: github.event.inputs.asana-task-url
run: bundle exec fastlane run asana_extract_task_id task_url:"${{ github.event.inputs.asana-task-url }}"

- name: Set parameters
id: set-parameters
env:
ASANA_TASK_URL: ${{ steps.find-asana-task.outputs.release_task_url || github.event.inputs.asana-task-url }}
RELEASE_BRANCH: ${{ steps.find-asana-task.outputs.release_branch || github.ref_name }}
TASK_ID: ${{ steps.find-asana-task.outputs.release_task_id || steps.task-id.outputs.asana_task_id }}
SKIP_APPSTORE: ${{ github.event.inputs.skip-appstore || false }} # make sure this is set to false on scheduled runs
run: |
if [[ "${RELEASE_BRANCH}" == "main" ]]; then
echo "::error::Workflow run from main branch and release branch wasn't found. Please re-run the workflow and specify a release branch."
exit 1
fi
echo "release-branch=${RELEASE_BRANCH}" >> $GITHUB_OUTPUT
echo "task-id=${TASK_ID}" >> $GITHUB_OUTPUT
echo "asana-task-url=${ASANA_TASK_URL}" >> $GITHUB_OUTPUT
echo "skip-appstore=${SKIP_APPSTORE}" >> $GITHUB_OUTPUT
- name: Validate release notes
env:
TASK_ID: ${{ steps.set-parameters.outputs.task-id }}
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
run: |
curl -fLSs "https://app.asana.com/api/1.0/tasks/${TASK_ID}?opt_fields=notes" \
-H "Authorization: Bearer ${ASANA_ACCESS_TOKEN}" \
| jq -r .data.notes \
| ./scripts/extract_release_notes.sh -r > raw_release_notes.txt
raw_release_notes="$(<raw_release_notes.txt)"
if [[ ${#raw_release_notes} == 0 || "$raw_release_notes" == *"<-- Add release notes here -->"* ]]; then
echo "::error::Release notes are empty or contain a placeholder. Please add release notes to the Asana task and restart the workflow."
exit 1
fi
bundle exec fastlane run validate_internal_release_bump \
platform:macos \
is_scheduled_release:"${{ github.event_name == 'schedule' }}" \
release_task_url:"${{ inputs.asana-task-url }}"
run_tests:

name: Run Tests

needs: validate_input_conditions

if: needs.validate_input_conditions.outputs.skip-release == 'false'
if: needs.validate_input_conditions.outputs.skip-release != 'true'
uses: ./.github/workflows/pr.yml
with:
branch: ${{ needs.validate_input_conditions.outputs.release-branch }}
Expand All @@ -151,7 +88,7 @@ jobs:
name: Increment Build Number

needs: [ validate_input_conditions, run_tests ]
runs-on: macos-14-xlarge
runs-on: macos-15-xlarge
timeout-minutes: 10

steps:
Expand All @@ -169,31 +106,20 @@ jobs:
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer

- 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
- name: Extract Asana Task ID
id: task-id
run: bundle exec fastlane run asana_extract_task_id task_url:"${{ needs.validate_input_conditions.outputs.asana-task-url }}"

- name: Update Asana tasks for the release
env:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
GH_TOKEN: ${{ github.token }}
BRANCH: ${{ needs.validate_input_conditions.outputs.release-branch }}
GITHUB_TOKEN: ${{ github.token }}
run: |
version="$(cut -d '/' -f 2 <<< "$BRANCH")"
./scripts/update_asana_for_release.sh internal ${{ steps.task-id.outputs.asana_task_id }} ${{ vars.MACOS_APP_BOARD_VALIDATION_SECTION_ID }} "${version}"
bundle exec fastlane run bump_build_number platform:macos
bundle exec fastlane run update_asana_for_release \
platform:macos \
release_type:internal \
release_task_id:"${{ needs.validate_input_conditions.outputs.asana-task-id }}" \
target_section_id:"${{ vars.MACOS_APP_BOARD_VALIDATION_SECTION_ID }}"
prepare_release:
name: Prepare Release
Expand Down
73 changes: 17 additions & 56 deletions .github/workflows/code_freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ name: Code Freeze

on:
workflow_dispatch:
inputs:
version:
description: "New release version (calculated automatically if not provided)"
required: false
type: string

jobs:

create_release_branch:

name: Create Release Branch

runs-on: macos-14-xlarge
runs-on: macos-15-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 }}
asana_task_url: ${{ steps.make_release_branch.outputs.asana_task_url }}

steps:

Expand All @@ -36,59 +41,15 @@ jobs:

- 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: Get Asana user ID
id: get-asana-user-id
shell: bash
run: bundle exec fastlane run asana_get_user_id_for_github_handle github_handle:"${{ github.actor }}"

- name: Create release task
id: create_release_task
env:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
ASSIGNEE_ID: ${{ steps.get-asana-user-id.outputs.asana_user_id }}
GITHUB_TOKEN: ${{ github.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 "marketing_version=${version}" >> $GITHUB_OUTPUT
echo "asana_task_id=${asana_task_id}" >> $GITHUB_OUTPUT
echo "asana_task_url=https://app.asana.com/0/0/${asana_task_id}/f" >> $GITHUB_OUTPUT
curl -fLSs -X POST "https://app.asana.com/api/1.0/sections/${{ vars.MACOS_APP_DEVELOPMENT_RELEASE_SECTION_ID }}/addTask" \
-H "Authorization: Bearer ${{ env.ASANA_ACCESS_TOKEN }}" \
-H "Content-Type: application/json" \
--output /dev/null \
-d "{\"data\": {\"task\": \"${asana_task_id}\"}}"
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\" }}"
- name: Update Asana tasks for the release
env:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
GH_TOKEN: ${{ github.token }}
run: |
./scripts/update_asana_for_release.sh \
internal \
${{ steps.create_release_task.outputs.asana_task_id }} \
${{ vars.MACOS_APP_BOARD_VALIDATION_SECTION_ID }} \
${{ steps.create_release_task.outputs.marketing_version }}
bundle exec fastlane run start_new_release \
platform:"macos" \
version:"${{ inputs.version }}" \
github_handle:"${{ github.actor }}" \
target_section_id:"${{ vars.MACOS_APP_BOARD_VALIDATION_SECTION_ID }}"
run_tests:

Expand All @@ -111,7 +72,7 @@ jobs:
name: Increment Build Number

needs: [ create_release_branch, run_tests ]
runs-on: macos-14-xlarge
runs-on: macos-15-xlarge
timeout-minutes: 10

steps:
Expand All @@ -130,10 +91,10 @@ jobs:
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 }}
GITHUB_TOKEN: ${{ github.token }}
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
bundle exec fastlane run bump_build_number platform:"macos"
prepare_release:
name: Prepare Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_variant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
ATB_VARIANT_NAME: ${{ inputs.atb-variant || github.event.inputs.atb-variant }}
ORIGIN_VARIANT_NAME: ${{ inputs.origin-variant || github.event.inputs.origin-variant }}

runs-on: macos-14
runs-on: macos-15
timeout-minutes: 15

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

name: Create Release Branch

runs-on: macos-14-xlarge
runs-on: macos-15-xlarge
timeout-minutes: 10

outputs:
Expand Down Expand Up @@ -89,4 +89,4 @@ jobs:
run: |
bundle exec fastlane run asana_add_comment \
task_url:"${{ steps.create_release_task.outputs.asana_task_url }}" \
template_name:"hotfix-branch-ready"
template_name:"hotfix-branch-ready"
Loading

0 comments on commit 167dc90

Please sign in to comment.