Skip to content

Commit

Permalink
Merge branch 'main' into tespach/phishing-error-page
Browse files Browse the repository at this point in the history
  • Loading branch information
not-a-rootkit committed May 21, 2024
2 parents 02c1d08 + 5f20c6c commit 43701cd
Show file tree
Hide file tree
Showing 419 changed files with 25,331 additions and 14,781 deletions.
2 changes: 1 addition & 1 deletion .github/actions/asana-create-action-item/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ runs:

- id: get-asana-user-id
if: github.event_name != 'schedule'
uses: duckduckgo/apple-infra/actions/asana-get-user-id-for-github-handle@main
uses: duckduckgo/apple-toolbox/actions/asana-get-user-id-for-github-handle@main
with:
access-token: ${{ inputs.access-token }}
github-handle: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/asana-log-message/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:

- id: get-asana-user-id
if: github.event_name != 'schedule'
uses: duckduckgo/apple-infra/actions/asana-get-user-id-for-github-handle@main
uses: duckduckgo/apple-toolbox/actions/asana-get-user-id-for-github-handle@main
with:
access-token: ${{ inputs.access-token }}
github-handle: ${{ github.actor }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/bump_internal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ jobs:
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 > release_notes.txt
release_notes="$(<release_notes.txt)"
if [[ ${#release_notes} == 0 || "$release_notes" == "<-- Add release notes here -->" ]]; then
echo "::error::Release notes are empty. Please add release notes to the Asana task and restart the workflow."
| ./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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/code_freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Get Asana user ID
id: get-asana-user-id
uses: duckduckgo/apple-infra/actions/asana-get-user-id-for-github-handle@main
uses: duckduckgo/apple-toolbox/actions/asana-get-user-id-for-github-handle@main
with:
access-token: ${{ secrets.ASANA_ACCESS_TOKEN }}
github-handle: ${{ github.actor }}
Expand Down Expand Up @@ -172,6 +172,7 @@ jobs:
uses: ./.github/workflows/tag_release.yml
with:
asana-task-url: ${{ needs.create_release_branch.outputs.asana_task_url }}
base-branch: ${{ github.ref_name }}
branch: ${{ needs.create_release_branch.outputs.release_branch_name }}
prerelease: true
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
curl -fLSs $(gh api https://api.github.com/repos/${{ github.repository }}/contents/scripts/assets/variants-release-mm-template.json?ref=${{ github.ref }} --jq .download_url) \
curl -fLSs $(gh api https://api.github.com/repos/${{ github.repository }}/contents/scripts/assets/variants-release-mm-template.json --jq .download_url) \
--output message-template.json
export MM_USER_HANDLE=$(base64 -d <<< ${{ secrets.MM_HANDLES_BASE64 }} | jq ".${{ github.actor }}" | tr -d '"')
Expand Down
34 changes: 32 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,36 @@ jobs:
env:
SHELLCHECK_OPTS: -x -P scripts -P scripts/helpers

bats:

name: Test Shell Scripts

runs-on: macos-13

steps:
- name: Check out the code
if: github.event_name == 'pull_request' || github.event_name == 'push'
uses: actions/checkout@v4

- name: Check out the code
if: github.event_name != 'pull_request' && github.event_name != 'push'
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch || github.ref_name }}

- name: Install Bats
run: brew install bats-core

- name: Run Bats tests
run: bats --formatter junit scripts/tests/* > bats-tests.xml

- name: Publish unit tests report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
check_name: "Test Report: Shell Scripts"
report_paths: 'bats-tests.xml'

tests:
name: Test

Expand Down Expand Up @@ -343,7 +373,7 @@ jobs:
create-asana-task:
name: Create Asana Task
needs: [swiftlint, tests, release-build, verify-autoconsent-bundle, private-api]
needs: [swiftlint, bats, tests, release-build, verify-autoconsent-bundle, private-api]

if: failure() && github.ref_name == 'main' && github.run_attempt == 1

Expand All @@ -360,7 +390,7 @@ jobs:

close-asana-task:
name: Close Asana Task
needs: [swiftlint, tests, release-build, verify-autoconsent-bundle, private-api]
needs: [swiftlint, bats, tests, release-build, verify-autoconsent-bundle, private-api]

if: success() && github.ref_name == 'main' && github.run_attempt > 1

Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/pr_task_url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Asana PR Task URL

on:
pull_request:
types: [opened, edited, closed, unlabeled, synchronize]
types: [opened, edited, closed, unlabeled, synchronize, review_requested]

jobs:

Expand Down Expand Up @@ -112,6 +112,24 @@ jobs:
if: ${{ needs.assert-project-membership.outputs.task_id }}
run: exit ${{ needs.assert-project-membership.outputs.failure }}

# When reviewer is assigned create a subtask in Asana if not existing already
create-asana-pr-subtask-if-needed:

name: "Create the PR subtask in Asana"

runs-on: ubuntu-latest
if: github.event.action == 'review_requested'

needs: [assert-project-membership]

steps:
- name: Create or Update PR Subtask
uses: duckduckgo/apple-toolbox/actions/asana-create-pr-subtask@main
with:
access-token: ${{ secrets.ASANA_ACCESS_TOKEN }}
asana-task-id: ${{ needs.assert-project-membership.outputs.task_id }}
github-reviewer-user: ${{ github.event.requested_reviewer.login }}

# When a PR is merged, move the task to the Waiting for Release section of the App Board.
mark-waiting-for-release:

Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/publish_dmg_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ jobs:
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 > release_notes.txt
release_notes="$(<release_notes.txt)"
if [[ ${#release_notes} == 0 || "$release_notes" == "<-- Add release notes here -->" ]]; then
echo "::error::Release notes are empty. Please add release notes to the Asana task and restart the workflow."
| jq -r .data.notes > release_task_content.txt
raw_release_notes="$(./scripts/extract_release_notes.sh -r < release_task_content.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
echo "RELEASE_NOTES_FILE=release_notes.txt" >> $GITHUB_ENV
./scripts/extract_release_notes.sh < release_task_content.txt > release_notes.html
echo "RELEASE_NOTES_FILE=release_notes.html" >> $GITHUB_ENV
- name: Set up Sparkle tools
env:
Expand Down Expand Up @@ -189,21 +189,21 @@ jobs:
./scripts/appcast_manager/appcastManager.swift \
--release-to-internal-channel \
--dmg ${DMG_PATH} \
--release-notes release_notes.txt \
--release-notes-html release_notes.html \
--key sparkle_private_key
;;
"public")
./scripts/appcast_manager/appcastManager.swift \
--release-to-public-channel \
--version ${VERSION} \
--release-notes release_notes.txt \
--release-notes-html release_notes.html \
--key sparkle_private_key
;;
"hotfix")
./scripts/appcast_manager/appcastManager.swift \
--release-hotfix-to-public-channel \
--dmg ${DMG_PATH} \
--release-notes release_notes.txt \
--release-notes-html release_notes.html \
--key sparkle_private_key
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 170
CURRENT_PROJECT_VERSION = 190
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 1.85.0
MARKETING_VERSION = 1.89.0
Loading

0 comments on commit 43701cd

Please sign in to comment.