From 8d0eb5b6e433d076550c29688581339e8a1acd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20=C5=81yp?= Date: Thu, 12 Sep 2024 23:55:21 +0200 Subject: [PATCH 1/2] Use new AsanaCreateActionItem action (#3264) Task/Issue URL: https://app.asana.com/0/1201392122292466/1208137627434489/f **Description**: Use new AsanaCreateActionItem action --- .../asana-create-action-item/action.yml | 115 ------------------ .../templates/appcast-failed-hotfix.yml | 36 ------ .../templates/appcast-failed-internal.yml | 37 ------ .../templates/appcast-failed-public.yml | 36 ------ .../templates/delete-branch-failed.yml | 15 --- .../templates/internal-release-tag-failed.yml | 46 ------- .../templates/merge-failed.yml | 32 ----- .../templates/public-release-tag-failed.yml | 38 ------ .../templates/run-publish-dmg-release.yml | 38 ------ .../update-asana-for-public-release.yml | 19 --- .../validate-check-for-updates-internal.yml | 41 ------- .../validate-check-for-updates-public.yml | 41 ------- .../migrate_asana_create_action_item.yml | 46 +++++++ .github/workflows/publish_dmg_release.yml | 52 ++++---- .github/workflows/tag_release.yml | 29 +++-- Gemfile.lock | 20 +-- fastlane/Pluginfile | 2 +- 17 files changed, 103 insertions(+), 540 deletions(-) delete mode 100644 .github/actions/asana-create-action-item/action.yml delete mode 100644 .github/actions/asana-create-action-item/templates/appcast-failed-hotfix.yml delete mode 100644 .github/actions/asana-create-action-item/templates/appcast-failed-internal.yml delete mode 100644 .github/actions/asana-create-action-item/templates/appcast-failed-public.yml delete mode 100644 .github/actions/asana-create-action-item/templates/delete-branch-failed.yml delete mode 100644 .github/actions/asana-create-action-item/templates/internal-release-tag-failed.yml delete mode 100644 .github/actions/asana-create-action-item/templates/merge-failed.yml delete mode 100644 .github/actions/asana-create-action-item/templates/public-release-tag-failed.yml delete mode 100644 .github/actions/asana-create-action-item/templates/run-publish-dmg-release.yml delete mode 100644 .github/actions/asana-create-action-item/templates/update-asana-for-public-release.yml delete mode 100644 .github/actions/asana-create-action-item/templates/validate-check-for-updates-internal.yml delete mode 100644 .github/actions/asana-create-action-item/templates/validate-check-for-updates-public.yml create mode 100644 .github/workflows/migrate_asana_create_action_item.yml diff --git a/.github/actions/asana-create-action-item/action.yml b/.github/actions/asana-create-action-item/action.yml deleted file mode 100644 index a5adf09d9d..0000000000 --- a/.github/actions/asana-create-action-item/action.yml +++ /dev/null @@ -1,115 +0,0 @@ -name: Add a Subtask to Asana Release Automation Task -description: Adds a task with an action item to the Asana release task's "Automation" subtask -inputs: - access-token: - description: "Asana access token" - required: true - type: string - release-task-url: - description: "Asana release task URL" - required: true - type: string - task-name: - description: "Task name" - required: false - type: string - notes: - description: "Task notes" - required: false - type: string - html-notes: - description: "Task HTML notes" - required: false - type: string - template-name: - description: | - Name of a template file (without extension) for the task content, relative to 'templates' subdirectory of the action. - The file is processed by envsubst before being sent to Asana. - required: false - type: string -outputs: - assignee-id: - description: "Assignee ID" - value: ${{ steps.set-assignee-id.outputs.assignee-id }} - new-task-id: - description: "New task ID" - value: ${{ steps.create-task.outputs.new-task-id }} -runs: - using: "composite" - steps: - - id: get-automation-subtask - shell: bash - env: - ASANA_ACCESS_TOKEN: ${{ inputs.access-token }} - run: bundle exec fastlane run asana_get_release_automation_subtask_id task_url:"${{ inputs.release-task-url }}" - - - id: get-asana-user-id - shell: bash - if: github.event_name != 'schedule' - run: bundle exec fastlane run asana_get_user_id_for_github_handle github_handle:"${{ github.actor }}" - - - id: set-assignee-id - shell: bash - env: - USER_ID: ${{ steps.get-asana-user-id.outputs.asana_user_id || steps.get-automation-subtask.outputs.asana_assignee_id }} - run: | - echo "assignee-id=${USER_ID}" >> $GITHUB_OUTPUT - - - id: process-template-payload - if: ${{ inputs.template-name }} - shell: bash - env: - ASSIGNEE_ID: ${{ steps.set-assignee-id.outputs.assignee-id }} - AUTOMATION_TASK_ID: ${{ steps.get-automation-subtask.outputs.asana_automation_task_id }} - TEMPLATE_PATH: ${{ github.action_path }}/templates/${{ inputs.template-name }}.yml - WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - run: | - if [ ! -f $TEMPLATE_PATH ]; then - echo "::error::Template file not found at $TEMPLATE_PATH" - exit 1 - fi - - # Process the template file with envsubst, turn into JSON, remove leading spaces and newlines on non-empty lines, and compact the JSON - payload="$(envsubst < $TEMPLATE_PATH | yq -o=j | sed -E 's/\\n( *)([^\\n])/\2/g' | jq -c)" - echo "payload-base64=$(base64 <<< $payload)" >> $GITHUB_OUTPUT - - - id: process-notes-payload - if: ${{ inputs.notes }} - shell: bash - env: - ASSIGNEE_ID: ${{ steps.set-assignee-id.outputs.assignee-id }} - AUTOMATION_TASK_ID: ${{ steps.get-automation-subtask.outputs.asana_automation_task_id }} - NOTES: ${{ inputs.notes }} - TASK_NAME: ${{ inputs.task-name }} - WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - run: | - payload="{ \"data\": { \"name\": \"${TASK_NAME}\", \"notes\": \"${NOTES}\n\nπŸ”— Workflow URL: ${WORKFLOW_URL}\", \"assignee\": \"${ASSIGNEE_ID}\" } }" - echo "payload-base64=$(base64 <<< $payload)" >> $GITHUB_OUTPUT - - - id: process-html-notes-payload - if: ${{ inputs.html-notes }} - shell: bash - env: - ASSIGNEE_ID: ${{ steps.set-assignee-id.outputs.assignee-id }} - AUTOMATION_TASK_ID: ${{ steps.get-automation-subtask.outputs.asana_automation_task_id }} - HTML_NOTES: ${{ inputs.html-notes }} - TASK_NAME: ${{ inputs.task-name }} - WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - run: | - payload="{ \"data\": { \"name\": \"${TASK_NAME}\", \"html_notes\": \"${HTML_NOTES}\", \"assignee\": \"${ASSIGNEE_ID}\" } }" - echo "payload-base64=$(base64 <<< $payload)" >> $GITHUB_OUTPUT - - - id: create-task - shell: bash - env: - ASANA_ACCESS_TOKEN: ${{ inputs.access-token }} - ASSIGNEE_ID: ${{ steps.set-assignee-id.outputs.assignee-id }} - TASK_ID: ${{ steps.get-automation-subtask.outputs.asana_automation_task_id }} - PAYLOAD_BASE64: ${{ steps.process-template-payload.outputs.payload-base64 || steps.process-notes-payload.outputs.payload-base64 || steps.process-html-notes-payload.outputs.payload-base64 }} - run: | - # Create a subtask and retrieve its ID from the response (.data.gid) to return as an output - new_task_id=$(set -o pipefail && curl -fLSs "https://app.asana.com/api/1.0/tasks/${TASK_ID}/subtasks?opt_fields=gid" \ - -H "Authorization: Bearer ${ASANA_ACCESS_TOKEN}" \ - -H 'content-type: application/json' \ - -d "$(base64 -d <<< $PAYLOAD_BASE64)" | jq -r .data.gid) - echo "new-task-id=$new_task_id" >> $GITHUB_OUTPUT \ No newline at end of file diff --git a/.github/actions/asana-create-action-item/templates/appcast-failed-hotfix.yml b/.github/actions/asana-create-action-item/templates/appcast-failed-hotfix.yml deleted file mode 100644 index 2242993e4c..0000000000 --- a/.github/actions/asana-create-action-item/templates/appcast-failed-hotfix.yml +++ /dev/null @@ -1,36 +0,0 @@ -data: - name: Generate appcast2.xml for ${TAG} hotfix release and upload assets to S3 - assignee: "${ASSIGNEE_ID}" - html_notes: | - - 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. - -
    -
  1. Create a new file called release-notes.txt on your disk. -
      -
    • Add each release note as a separate line and don't add bullet points (β€’) – the script will add them automatically.
    • -
  2. -
  3. Run appcastManager: -
      -
    • ./scripts/appcast_manager/appcastManager.swift --release-hotfix-to-public-channel --dmg ~/Downloads/${DMG_NAME} --release-notes release-notes.txt
    • -
  4. -
  5. Verify that the new build is in the appcast file with the latest release notes and no internal channel tag. The phased rollout tag should not be present: -
      -
    • <sparkle:phasedRolloutInterval>43200</sparkle:phasedRolloutInterval>
    • -
  6. -
  7. Run upload_to_s3.sh script: -
      -
    • ./scripts/upload_to_s3/upload_to_s3.sh --run --overwrite-duckduckgo-dmg ${VERSION}
    • -
  8. -
- When done, please verify that "Check for Updates" works correctly: -
    -
  1. Launch a debug version of the app with an old version number.
  2. -
  3. Make sure you're not identified as an internal user in the app.
  4. -
  5. Go to Main Menu β†’ DuckDuckGo β†’ Check for Updates...
  6. -
  7. Verify that you're being offered to update to ${TAG}.
  8. -
  9. Verify that the update works.
  10. -
- - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/actions/asana-create-action-item/templates/appcast-failed-internal.yml b/.github/actions/asana-create-action-item/templates/appcast-failed-internal.yml deleted file mode 100644 index fcd12b1b14..0000000000 --- a/.github/actions/asana-create-action-item/templates/appcast-failed-internal.yml +++ /dev/null @@ -1,37 +0,0 @@ -data: - name: Generate appcast2.xml for ${TAG} internal release and upload assets to S3 - assignee: "${ASSIGNEE_ID}" - html_notes: | - - 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. - -
    -
  1. Download the DMG for ${TAG} release.
  2. -
  3. Create a new file called release-notes.txt on your disk. -
      -
    • Add each release note as a separate line and don't add bullet points (β€’) – the script will add them automatically.
    • -
  4. -
  5. Run appcastManager: -
      -
    • ./scripts/appcast_manager/appcastManager.swift --release-to-internal-channel --dmg ~/Downloads/${DMG_NAME} --release-notes release-notes.txt
    • -
  6. -
  7. Verify that the new build is in the appcast file with the following internal channel tag: -
      -
    • <sparkle:channel>internal-channel</sparkle:channel>
    • -
  8. -
  9. Run upload_to_s3.sh script: -
      -
    • ./scripts/upload_to_s3/upload_to_s3.sh --run
    • -
  10. -
- When done, please verify that "Check for Updates" works correctly: -
    -
  1. Launch a debug version of the app with an old version number.
  2. -
  3. Identify as an internal user in the app.
  4. -
  5. Go to Main Menu β†’ DuckDuckGo β†’ Check for Updates...
  6. -
  7. Verify that you're being offered to update to ${TAG}.
  8. -
  9. Verify that the update works.
  10. -
- - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/actions/asana-create-action-item/templates/appcast-failed-public.yml b/.github/actions/asana-create-action-item/templates/appcast-failed-public.yml deleted file mode 100644 index 0cbe7cb851..0000000000 --- a/.github/actions/asana-create-action-item/templates/appcast-failed-public.yml +++ /dev/null @@ -1,36 +0,0 @@ -data: - name: Generate appcast2.xml for ${TAG} public release and upload assets to S3 - assignee: "${ASSIGNEE_ID}" - html_notes: | - - Publishing ${TAG} release failed in CI. Please follow the steps to generate the appcast file and upload files to S3 from your local machine. - -
    -
  1. Create a new file called release-notes.txt on your disk. -
      -
    • Add each release note as a separate line and don't add bullet points (β€’) – the script will add them automatically.
    • -
  2. -
  3. Run appcastManager: -
      -
    • ./scripts/appcast_manager/appcastManager.swift --release-to-public-channel --version ${VERSION} --release-notes release-notes.txt
    • -
  4. -
  5. 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: -
      -
    • <sparkle:phasedRolloutInterval>43200</sparkle:phasedRolloutInterval>
    • -
  6. -
  7. Run upload_to_s3.sh script: -
      -
    • ./scripts/upload_to_s3/upload_to_s3.sh --run --overwrite-duckduckgo-dmg ${VERSION}
    • -
  8. -
- When done, please verify that "Check for Updates" works correctly: -
    -
  1. Launch a debug version of the app with an old version number.
  2. -
  3. Make sure you're not identified as an internal user in the app.
  4. -
  5. Go to Main Menu β†’ DuckDuckGo β†’ Check for Updates...
  6. -
  7. Verify that you're being offered to update to ${TAG}.
  8. -
  9. Verify that the update works.
  10. -
- - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/actions/asana-create-action-item/templates/delete-branch-failed.yml b/.github/actions/asana-create-action-item/templates/delete-branch-failed.yml deleted file mode 100644 index 61225c1281..0000000000 --- a/.github/actions/asana-create-action-item/templates/delete-branch-failed.yml +++ /dev/null @@ -1,15 +0,0 @@ -data: - name: Delete ${BRANCH} branch - assignee: "${ASSIGNEE_ID}" - html_notes: | - - The ${TAG} public release has been successfully tagged and published in GitHub releases, - but deleting ${BRANCH} branch failed. Please delete it manually: - - Complete this task when ready, or if the release branch has already been deleted. - - - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/actions/asana-create-action-item/templates/internal-release-tag-failed.yml b/.github/actions/asana-create-action-item/templates/internal-release-tag-failed.yml deleted file mode 100644 index ddc2e6471a..0000000000 --- a/.github/actions/asana-create-action-item/templates/internal-release-tag-failed.yml +++ /dev/null @@ -1,46 +0,0 @@ -data: - name: Tag ${BRANCH} branch and create GitHub release - assignee: "${ASSIGNEE_ID}" - html_notes: | - - Failed to tag the release with ${TAG} tag. - - Please follow instructions below to tag the branch, make GitHub release and merge release branch to ${BASE_BRANCH} manually. - - - Issue the following git commands to tag the release and merge the branch: - - - To create GitHub release: - - - 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 task and handle them as needed. - - - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/actions/asana-create-action-item/templates/merge-failed.yml b/.github/actions/asana-create-action-item/templates/merge-failed.yml deleted file mode 100644 index db6e4c8aa7..0000000000 --- a/.github/actions/asana-create-action-item/templates/merge-failed.yml +++ /dev/null @@ -1,32 +0,0 @@ -data: - name: Merge ${BRANCH} to ${BASE_BRANCH} - assignee: "${ASSIGNEE_ID}" - html_notes: | - - The ${TAG} release has been successfully tagged and published in GitHub releases, - but merging to ${BASE_BRANCH} failed. Please resolve conflicts and merge ${BRANCH} to ${BASE_BRANCH} manually. - - - Issue the following git commands: - - Complete this task when ready and proceed with testing the build. - - - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/actions/asana-create-action-item/templates/public-release-tag-failed.yml b/.github/actions/asana-create-action-item/templates/public-release-tag-failed.yml deleted file mode 100644 index 94e7ae9c02..0000000000 --- a/.github/actions/asana-create-action-item/templates/public-release-tag-failed.yml +++ /dev/null @@ -1,38 +0,0 @@ -data: - name: Tag ${BRANCH} branch, delete it, and create GitHub release - assignee: "${ASSIGNEE_ID}" - html_notes: | - - Failed to tag the release with ${TAG} tag. - - Please follow instructions below to tag the branch, make GitHub release and delete the release branch manually. - - - Issue the following git commands to tag the release and delete the branch: - - - To create GitHub release: - - - Complete this task when ready. - - - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/actions/asana-create-action-item/templates/run-publish-dmg-release.yml b/.github/actions/asana-create-action-item/templates/run-publish-dmg-release.yml deleted file mode 100644 index a154f26cc6..0000000000 --- a/.github/actions/asana-create-action-item/templates/run-publish-dmg-release.yml +++ /dev/null @@ -1,38 +0,0 @@ -data: - name: Run Publish DMG Release GitHub Actions workflow - assignee: "${ASSIGNEE_ID}" - html_notes: | - -

Using GH CLI

- Run the following command: - - - gh workflow run publish_dmg_release.yml --ref ${BRANCH} -f asana-task-url=${ASANA_TASK_URL} -f tag=${TAG} -f release-type=internal -

Using GitHub web UI

-
    -
  1. Open Publish DMG Release workflow page.
  2. -
  3. Click "Run Workflow" and fill in the form as follows: -
      -
    • Branch ${BRANCH}
    • -
    • Asana release task URL ${ASANA_TASK_URL}
    • -
    • Tag to publish ${TAG}
    • -
    • Release Type internal
    • -
  4. -
- - The GitHub Action workflow does the following: - - - Complete this task when ready and proceed with testing the build. If GitHub Actions is unavailable, you'll find manual instructions in the Run Publish DMG Release GitHub Actions workflow subtask of Make Internal Release task. - - - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/actions/asana-create-action-item/templates/update-asana-for-public-release.yml b/.github/actions/asana-create-action-item/templates/update-asana-for-public-release.yml deleted file mode 100644 index 17a7c696c5..0000000000 --- a/.github/actions/asana-create-action-item/templates/update-asana-for-public-release.yml +++ /dev/null @@ -1,19 +0,0 @@ -data: - name: Move release task and included items to "Done" section in macOS App Board and close them if possible - assignee: "${ASSIGNEE_ID}" - html_notes: | - - Automation failed to update Asana for the public release. Please follow the steps below. -
    -
  1. Open and select the List view
  2. -
  3. Scroll to the "Validation" section.
  4. -
  5. Select all the tasks in that section.
  6. -
  7. Drag and drop all the selected tasks to the "Done" section
  8. -
  9. Close all tasks that are not incidents and don't belong to project, including the release task itself.
  10. -
- - Complete this task when ready. - - - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/actions/asana-create-action-item/templates/validate-check-for-updates-internal.yml b/.github/actions/asana-create-action-item/templates/validate-check-for-updates-internal.yml deleted file mode 100644 index 61d5b86207..0000000000 --- a/.github/actions/asana-create-action-item/templates/validate-check-for-updates-internal.yml +++ /dev/null @@ -1,41 +0,0 @@ -data: - name: Validate that 'Check For Updates' upgrades to ${TAG} for internal users - assignee: "${ASSIGNEE_ID}" - html_notes: | - -

Build ${TAG} has been released internally via Sparkle πŸŽ‰

- Please verify that "Check for Updates" works correctly: -
    -
  1. Launch a debug version of the app with an old version number.
  2. -
  3. Identify as an internal user in the app.
  4. -
  5. Go to Main Menu β†’ DuckDuckGo β†’ Check for Updates...
  6. -
  7. Verify that you're being offered to update to ${TAG}.
  8. -
  9. Verify that the update works.
  10. -
-

🚨In case "Check for Updates" is broken

- You can restore previous version of the appcast2.xml: -
    -
  1. Download the ${OLD_APPCAST_NAME} file attached to this task.
  2. -
  3. Log in to AWS session: -
      -
    • aws --profile ddg-macos sso login
    • -
  4. -
  5. Overwrite appcast2.xml with the old version: -
      -
    • aws --profile ddg-macos s3 cp ${OLD_APPCAST_NAME} s3://${RELEASE_BUCKET_NAME}/${RELEASE_BUCKET_PREFIX}/appcast2.xml --acl public-read
    • -
  6. -
- -
-

Summary of automated changes

-

Changes to appcast2.xml

- See the attached ${APPCAST_PATCH_NAME} file. -

Release notes

- See the attached ${RELEASE_NOTES_FILE} file for release notes extracted automatically from the release task description. -

List of files uploaded to S3

-
    - ${FILES_UPLOADED} -
- - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/actions/asana-create-action-item/templates/validate-check-for-updates-public.yml b/.github/actions/asana-create-action-item/templates/validate-check-for-updates-public.yml deleted file mode 100644 index e973fadd81..0000000000 --- a/.github/actions/asana-create-action-item/templates/validate-check-for-updates-public.yml +++ /dev/null @@ -1,41 +0,0 @@ -data: - name: Validate that 'Check For Updates' upgrades to ${TAG} - assignee: "${ASSIGNEE_ID}" - html_notes: | - -

Build ${TAG} has been released publicly via Sparkle πŸŽ‰

- Please verify that "Check for Updates" works correctly: -
    -
  1. Launch a debug version of the app with an old version number.
  2. -
  3. Make sure you're not identified as an internal user in the app.
  4. -
  5. Go to Main Menu β†’ DuckDuckGo β†’ Check for Updates...
  6. -
  7. Verify that you're being offered to update to ${TAG}.
  8. -
  9. Verify that the update works.
  10. -
-

🚨In case "Check for Updates" is broken

- You can restore previous version of the appcast2.xml: -
    -
  1. Download the ${OLD_APPCAST_NAME} file attached to this task.
  2. -
  3. Log in to AWS session: -
      -
    • aws --profile ddg-macos sso login
    • -
  4. -
  5. Overwrite appcast2.xml with the old version: -
      -
    • aws --profile ddg-macos s3 cp ${OLD_APPCAST_NAME} s3://${RELEASE_BUCKET_NAME}/${RELEASE_BUCKET_PREFIX}/appcast2.xml --acl public-read
    • -
  6. -
- -
-

Summary of automated changes

-

Changes to appcast2.xml

- See the attached ${APPCAST_PATCH_NAME} file. -

Release notes

- See the attached ${RELEASE_NOTES_FILE} file for release notes extracted automatically from the release task description. -

List of files uploaded to S3

-
    - ${FILES_UPLOADED} -
- - πŸ”— Workflow URL: ${WORKFLOW_URL}. - diff --git a/.github/workflows/migrate_asana_create_action_item.yml b/.github/workflows/migrate_asana_create_action_item.yml new file mode 100644 index 0000000000..47399df65d --- /dev/null +++ b/.github/workflows/migrate_asana_create_action_item.yml @@ -0,0 +1,46 @@ +name: Migration Test - Asana Create Action Item + +on: + push: + workflow_dispatch: + +jobs: + test: + + name: Test + + runs-on: macos-14 + + steps: + + - name: Check out the code + uses: actions/checkout@v4 + + - name: Set up fastlane + run: bundle install + + - name: Test asana-create-action-item comment + id: create-create-action-item + env: + APP_BOARD_ASANA_PROJECT_ID: ${{ vars.MACOS_APP_BOARD_ASANA_PROJECT_ID }} + ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} + WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + bundle exec fastlane run asana_create_action_item \ + task_url:"https://app.asana.com/0/1201621708115095/1208137627434473/f" \ + template_name:"update-asana-for-public-release" \ + github_handle:"${{ github.actor }}" \ + is_scheduled_release:"${{ github.event_name == 'schedule' }}" + + - name: Create Publish DMG Release task on failure + id: create-publish-dmg-task-on-failure + env: + ASANA_TASK_URL: "https://app.asana.com/0/1201621708115095/1208137627434473/f" + ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} + WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + bundle exec fastlane run asana_create_action_item \ + task_url:"https://app.asana.com/0/1201621708115095/1208137627434473/f" \ + template_name:"run-publish-dmg-release" \ + github_handle:"${{ github.actor }}" \ + is_scheduled_release:"${{ github.event_name == 'schedule' }}" diff --git a/.github/workflows/publish_dmg_release.yml b/.github/workflows/publish_dmg_release.yml index 86f49dfdd5..a566b210f3 100644 --- a/.github/workflows/publish_dmg_release.yml +++ b/.github/workflows/publish_dmg_release.yml @@ -313,34 +313,40 @@ jobs: - name: Create Asana task id: create-task if: always() - uses: ./.github/actions/asana-create-action-item - with: - access-token: ${{ secrets.ASANA_ACCESS_TOKEN }} - release-task-url: ${{ env.asana-task-url }} - template-name: ${{ steps.asana-templates.outputs.task-template }} + env: + ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} + run: | + bundle exec fastlane run asana_create_action_item \ + task_url:"${{ env.asana-task-url }}" \ + template_name:"${{ steps.asana-templates.outputs.task-template }}" \ + github_handle:"${{ github.actor }}" \ + is_scheduled_release:"${{ github.event_name == 'schedule' }}" - name: Create Asana task to handle Asana paperwork id: create-asana-paperwork-task if: ${{ steps.update-asana.outcome == 'failure' }} - uses: ./.github/actions/asana-create-action-item env: APP_BOARD_ASANA_PROJECT_ID: ${{ vars.MACOS_APP_BOARD_ASANA_PROJECT_ID }} - with: - access-token: ${{ secrets.ASANA_ACCESS_TOKEN }} - release-task-url: ${{ env.asana-task-url }} - template-name: update-asana-for-public-release + ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} + run: | + bundle exec fastlane run asana_create_action_item \ + task_url:"${{ env.asana-task-url }}" \ + template_name:"update-asana-for-public-release" \ + github_handle:"${{ github.actor }}" \ + is_scheduled_release:"${{ github.event_name == 'schedule' }}" - name: Create Asana task to announce the release id: create-announcement-task if: ${{ env.RELEASE_TYPE != 'internal' }} - uses: ./.github/actions/asana-create-action-item env: - html-notes: ${{ steps.update-asana.outputs.announcement-task-contents }} - with: - access-token: ${{ secrets.ASANA_ACCESS_TOKEN }} - html-notes: ${{ env.html-notes }} - release-task-url: ${{ env.asana-task-url }} - task-name: Announce the release to the company + ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} + run: | + bundle exec fastlane run asana_create_action_item \ + task_url:"${{ env.asana-task-url }}" \ + task_name:"Announce the release to the company" \ + html_notes:"${{ steps.update-asana.outputs.announcement-task-contents }}" \ + github_handle:"${{ github.actor }}" \ + is_scheduled_release:"${{ github.event_name == 'schedule' }}" - name: Upload patch to the Asana task id: upload-patch @@ -350,7 +356,7 @@ jobs: run: | bundle exec fastlane run asana_upload \ file_name:"${{ env.SPARKLE_DIR }}/${{ steps.appcast.outputs.appcast-patch-name }}" \ - task_id:"${{ steps.create-task.outputs.new-task-id }}" + task_id:"${{ steps.create-task.outputs.asana_new_task_id }}" - name: Upload old appcast file to the Asana task id: upload-old-appcast @@ -360,7 +366,7 @@ jobs: run: | bundle exec fastlane run asana_upload \ file_name:"${{ env.OLD_APPCAST_NAME }}" \ - task_id:"${{ steps.create-task.outputs.new-task-id }}" + task_id:"${{ steps.create-task.outputs.asana_new_task_id }}" - name: Upload release notes to the Asana task id: upload-release-notes @@ -370,14 +376,14 @@ jobs: run: | bundle exec fastlane run asana_upload \ file_name:"${{ env.RELEASE_NOTES_FILE }}" \ - task_id:"${{ steps.create-task.outputs.new-task-id }}" + task_id:"${{ steps.create-task.outputs.asana_new_task_id }}" - name: Report status if: always() env: - ANNOUNCEMENT_TASK_ID: ${{ steps.create-announcement-task.outputs.new-task-id }} - ASSIGNEE_ID: ${{ steps.create-task.outputs.assignee-id }} - TASK_ID: ${{ steps.create-task.outputs.new-task-id }} + ANNOUNCEMENT_TASK_ID: ${{ steps.create-announcement-task.outputs.asana_new_task_id }} + ASSIGNEE_ID: ${{ steps.create-task.outputs.asana_assignee_id }} + TASK_ID: ${{ steps.create-task.outputs.asana_new_task_id }} ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} run: | bundle exec fastlane run asana_log_message \ diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_release.yml index 7af9671eff..5cd4b68fb9 100644 --- a/.github/workflows/tag_release.yml +++ b/.github/workflows/tag_release.yml @@ -176,28 +176,33 @@ jobs: - name: Create Asana task on failure id: create-task-on-failure if: failure() || env.MERGE_OR_DELETE_FAILED == 'true' - uses: ./.github/actions/asana-create-action-item - with: - access-token: ${{ secrets.ASANA_ACCESS_TOKEN }} - release-task-url: ${{ env.asana-task-url }} - template-name: ${{ steps.asana-failure-templates.outputs.task-template }} + env: + ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} + run: | + bundle exec fastlane run asana_create_action_item \ + task_url:"${{ env.asana-task-url }}" \ + template_name:${{ steps.asana-failure-templates.outputs.task-template }} \ + github_handle:"${{ github.actor }}" \ + is_scheduled_release:"${{ github.event_name == 'schedule' }}" - name: Create Publish DMG Release task on failure id: create-publish-dmg-task-on-failure if: failure() && env.internal-release-bump == 'true' - uses: ./.github/actions/asana-create-action-item env: ASANA_TASK_URL: ${{ env.asana-task-url }} - with: - access-token: ${{ secrets.ASANA_ACCESS_TOKEN }} - release-task-url: ${{ env.asana-task-url }} - template-name: run-publish-dmg-release + ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} + run: | + bundle exec fastlane run asana_create_action_item \ + task_url:"${{ env.asana-task-url }}" \ + template_name:"run-publish-dmg-release" \ + github_handle:"${{ github.actor }}" \ + is_scheduled_release:"${{ github.event_name == 'schedule' }}" - name: Report failure if: failure() || env.MERGE_OR_DELETE_FAILED == 'true' env: - ASSIGNEE_ID: ${{ steps.create-task-on-failure.outputs.assignee-id }} - TASK_ID: ${{ steps.create-task-on-failure.outputs.new-task-id }} + ASSIGNEE_ID: ${{ steps.create-task-on-failure.outputs.asana_assignee_id }} + TASK_ID: ${{ steps.create-task-on-failure.outputs.asana_new_task_id }} ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} run: | bundle exec fastlane run asana_log_message \ diff --git a/Gemfile.lock b/Gemfile.lock index 615696eb4b..57f178e5a8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,9 @@ GIT remote: https://github.com/duckduckgo/fastlane-plugin-ddg_apple_automation - revision: 4a6f8106a0a420276cf2209f77eca004fef10aa6 - tag: 0.8.0 + revision: 2b3be3bc65c91f08c3897cf78cb8205ff0602489 + branch: jacek/asana-create-action-item specs: - fastlane-plugin-ddg_apple_automation (0.8.0) + fastlane-plugin-ddg_apple_automation (0.8.1) asana climate_control httpparty @@ -26,17 +26,17 @@ GEM oauth2 (>= 1.4, < 3) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.971.0) - aws-sdk-core (3.203.0) + aws-partitions (1.974.0) + aws-sdk-core (3.205.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.89.0) - aws-sdk-core (~> 3, >= 3.203.0) + aws-sdk-kms (1.91.0) + aws-sdk-core (~> 3, >= 3.205.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.160.0) - aws-sdk-core (~> 3, >= 3.203.0) + aws-sdk-s3 (1.162.0) + aws-sdk-core (~> 3, >= 3.205.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) aws-sigv4 (1.9.1) @@ -263,4 +263,4 @@ DEPENDENCIES httparty BUNDLED WITH - 2.4.4 + 2.4.19 diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index ff8628dba7..108f5f2362 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -2,4 +2,4 @@ # # Ensure this file is checked in to source control! -gem 'fastlane-plugin-ddg_apple_automation', git: 'https://github.com/duckduckgo/fastlane-plugin-ddg_apple_automation', tag: '0.8.0' +gem 'fastlane-plugin-ddg_apple_automation', git: 'https://github.com/duckduckgo/fastlane-plugin-ddg_apple_automation', tag: '0.9.0' From ee8c64039f99ae1086cb9446d5de0cb98eef678e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20=C5=81yp?= Date: Fri, 13 Sep 2024 00:02:26 +0200 Subject: [PATCH 2/2] Remove migration file (#3270) Task/Issue URL: https://app.asana.com/0/1201392122292466/1208137627434489/f **Description**: Remove temporary migration file --- .../migrate_asana_create_action_item.yml | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 .github/workflows/migrate_asana_create_action_item.yml diff --git a/.github/workflows/migrate_asana_create_action_item.yml b/.github/workflows/migrate_asana_create_action_item.yml deleted file mode 100644 index 47399df65d..0000000000 --- a/.github/workflows/migrate_asana_create_action_item.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Migration Test - Asana Create Action Item - -on: - push: - workflow_dispatch: - -jobs: - test: - - name: Test - - runs-on: macos-14 - - steps: - - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up fastlane - run: bundle install - - - name: Test asana-create-action-item comment - id: create-create-action-item - env: - APP_BOARD_ASANA_PROJECT_ID: ${{ vars.MACOS_APP_BOARD_ASANA_PROJECT_ID }} - ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} - WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - run: | - bundle exec fastlane run asana_create_action_item \ - task_url:"https://app.asana.com/0/1201621708115095/1208137627434473/f" \ - template_name:"update-asana-for-public-release" \ - github_handle:"${{ github.actor }}" \ - is_scheduled_release:"${{ github.event_name == 'schedule' }}" - - - name: Create Publish DMG Release task on failure - id: create-publish-dmg-task-on-failure - env: - ASANA_TASK_URL: "https://app.asana.com/0/1201621708115095/1208137627434473/f" - ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} - WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - run: | - bundle exec fastlane run asana_create_action_item \ - task_url:"https://app.asana.com/0/1201621708115095/1208137627434473/f" \ - template_name:"run-publish-dmg-release" \ - github_handle:"${{ github.actor }}" \ - is_scheduled_release:"${{ github.event_name == 'schedule' }}"