Skip to content

Commit

Permalink
GHA: Notify Release process to Mattermost (#5274)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1174433894299346/1208763472018617/f

### Description
We’ve recently added a new GHA that allows us to send messages to
Mattermost.
This is useful for automated process that other team members need to be
aware of.
As a first use of this action, we’d like to notify the main channel of
the release process updates.
  • Loading branch information
malmstein authored Jan 9, 2025
1 parent 89564aa commit 98e51ce
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 5 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/release_create_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}
GH_TOKEN: ${{ secrets.GT_DAXMOBILE }}
emoji_info: ":information_source:" # ℹ️

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -46,6 +47,16 @@ jobs:
run: |
bundle exec fastlane android tag_and_push_release_version app_version:${{ github.event.inputs.app-version }}
- name: Notify Mattermost
id: send-mm-message
uses: duckduckgo/[email protected]
with:
mattermost-token: ${{ secrets.MM_AUTH_TOKEN }}
mattermost-team-id: ${{ secrets.MM_TEAM_ID }}
mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }}
mattermost-message: ${{env.emoji_start}} Release ${{ github.event.inputs.app-version }}. Tag created.
action: 'send-mattermost-message'

- name: Create Asana task when workflow failed
if: ${{ failure() }}
id: create-failure-task
Expand All @@ -56,4 +67,15 @@ jobs:
asana-section: ${{ vars.GH_ANDROID_APP_INCOMING_SECTION_ID }}
asana-task-name: GH Workflow Failure - Tag Android Release
asana-task-description: Tag Android Release has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'create-asana-task'
action: 'create-asana-task'

- name: Notify Mattermost when workflow failed
if: ${{ failure() }}
id: send-mm-message-error
uses: duckduckgo/[email protected]
with:
mattermost-token: ${{ secrets.MM_AUTH_TOKEN }}
mattermost-team-id: ${{ secrets.MM_TEAM_ID }}
mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }}
mattermost-message: ${{env.emoji_start}} Tag Android Release has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'send-mattermost-message'
35 changes: 34 additions & 1 deletion .github/workflows/release_create_task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:

env:
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}
emoji_start: ":flight_departure:" # 🛫
emoji_info: ":information_source:" # ℹ️

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -38,6 +40,16 @@ jobs:
brew tap cdrussell/aarb
brew install aarb
- name: Notify Mattermost of Release starting
id: send-mm-release-starting
uses: duckduckgo/[email protected]
with:
mattermost-token: ${{ secrets.MM_AUTH_TOKEN }}
mattermost-team-id: ${{ secrets.MM_TEAM_ID }}
mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }}
mattermost-message: ${{env.emoji_start}} Starting release process for version ${{ github.event.inputs.app-version }}
action: 'send-mattermost-message'

- name: Create task in Asana
run: |
AndroidAsanaBridge version=${{ github.event.inputs.app-version }} action=createRelease,tagPendingTasks,addLinksToDescription,removePendingTasks
Expand All @@ -51,6 +63,16 @@ jobs:
project_gid: ${{ vars.GH_ANDROID_RELEASE_BOARD_PROJECT_ID }}
username: ${{ github.actor }}

- name: Notify Mattermost of Task created
id: send-mm-task-created
uses: duckduckgo/[email protected]
with:
mattermost-token: ${{ secrets.MM_AUTH_TOKEN }}
mattermost-team-id: ${{ secrets.MM_TEAM_ID }}
mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }}
mattermost-message: ${{env.emoji_info}} Release ${{ github.event.inputs.app-version }} Asana task successfully created. See https://app.asana.com/0/1184843898389381/1205105962934096
action: 'send-mattermost-message'

- name: Create Asana task when workflow failed
if: ${{ failure() }}
uses: duckduckgo/[email protected]
Expand All @@ -60,4 +82,15 @@ jobs:
asana-section: ${{ vars.GH_ANDROID_APP_INCOMING_SECTION_ID }}
asana-task-name: GH Workflow Failure - Create Android App Release Task
asana-task-description: The Create Android App Release Task workflow has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'create-asana-task'
action: 'create-asana-task'

- name: Notify Mattermost when workflow failed
if: ${{ failure() }}
id: send-mm-message-error
uses: duckduckgo/[email protected]
with:
mattermost-token: ${{ secrets.MM_AUTH_TOKEN }}
mattermost-team-id: ${{ secrets.MM_TEAM_ID }}
mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }}
asana-task-description: The Create Android App Release Task workflow has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'send-mattermost-message'
25 changes: 23 additions & 2 deletions .github/workflows/release_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ jobs:
if: always()
run: find . -name "*.apk" -exec mv '{}' apk/release.apk \;

- name: Notify Mattermost of Maestro tests
id: send-mm-tests-started
uses: duckduckgo/[email protected]
with:
mattermost-token: ${{ secrets.MM_AUTH_TOKEN }}
mattermost-team-id: ${{ secrets.MM_TEAM_ID }}
mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }}
mattermost-message: Starting to run Release tests for version ${{ github.event.inputs.app-version }} successfully created. See https://app.asana.com/0/1184843898389381/1205105962934096
action: 'send-mattermost-message'

- name: Release tests flows
uses: mobile-dev-inc/[email protected]
with:
Expand All @@ -82,5 +92,16 @@ jobs:
asana-project: ${{ vars.GH_ANDROID_APP_PROJECT_ID }}
asana-section: ${{ vars.GH_ANDROID_APP_INCOMING_SECTION_ID }}
asana-task-name: GH Workflow Failure - Tag Android Release (Robin)
asana-task-description: Tag Android Release has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'create-asana-task'
asana-task-description: Run Release Tests in Maestro has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'create-asana-task'

- name: Notify Mattermost when workflow failed
if: ${{ failure() }}
id: send-mm-message-error
uses: duckduckgo/[email protected]
with:
mattermost-token: ${{ secrets.MM_AUTH_TOKEN }}
mattermost-team-id: ${{ secrets.MM_TEAM_ID }}
mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }}
asana-task-description: Run Release Tests in Maestro has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'send-mattermost-message'
34 changes: 33 additions & 1 deletion .github/workflows/release_upload_play_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}
GH_TOKEN: ${{ secrets.GT_DAXMOBILE }}
GOOGLE_APPLICATION_CREDENTIALS: '#{ENV["HOME"]}/jenkins_static/com.duckduckgo.mobile.android/ddg-upload-firebase.json'
emoji_info: ":information_source:" # ℹ️

jobs:
release-production:
Expand Down Expand Up @@ -76,11 +77,31 @@ jobs:
run: |
bundle exec fastlane deploy_playstore
- name: Notify Mattermost of Play Store upload
id: send-mm-message-ps-upload
uses: duckduckgo/[email protected]
with:
mattermost-token: ${{ secrets.MM_AUTH_TOKEN }}
mattermost-team-id: ${{ secrets.MM_TEAM_ID }}
mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }}
mattermost-message: ${{env.emoji_start}} Release ${{ github.event.inputs.app-version }}. AAB uploaded to Play Store. See https://play.google.com/console/u/0/developers/5949020878215944484/app/4974643806384870294/releases/overview
action: 'send-mattermost-message'

- name: Upload Universal APK to Github
id: upload_bundle_github
run: |
bundle exec fastlane deploy_github
- name: Notify Mattermost of GH upload
id: send-mm-message-gh-upload
uses: duckduckgo/[email protected]
with:
mattermost-token: ${{ secrets.MM_AUTH_TOKEN }}
mattermost-team-id: ${{ secrets.MM_TEAM_ID }}
mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }}
mattermost-message: ${{env.emoji_start}} Release ${{ github.event.inputs.app-version }}. Universal APK uploaded to Github. See https://github.com/duckduckgo/Android/releases
action: 'send-mattermost-message'

- name: Create Asana task when workflow failed
if: ${{ failure() }}
uses: duckduckgo/[email protected]
Expand All @@ -90,4 +111,15 @@ jobs:
asana-section: ${{ vars.GH_ANDROID_APP_INCOMING_SECTION_ID }}
asana-task-name: GH Workflow Failure - Production Release
asana-task-description: The Production Release to Play Store and Github workflow has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'create-asana-task'
action: 'create-asana-task'

- name: Notify Mattermost when workflow failed
if: ${{ failure() }}
id: send-mm-message-error
uses: duckduckgo/[email protected]
with:
mattermost-token: ${{ secrets.MM_AUTH_TOKEN }}
mattermost-team-id: ${{ secrets.MM_TEAM_ID }}
mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }}
asana-task-description: The Production Release to Play Store and Github workflow has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'send-mattermost-message'
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2025 DuckDuckGo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.duckduckgo.savedsites.impl

import com.duckduckgo.anvil.annotations.ContributesRemoteFeature
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.feature.toggles.api.Toggle

@ContributesRemoteFeature(
scope = AppScope::class,
featureName = "bookmarksSorting",
)
interface BookmarksSortingFeature {
@Toggle.DefaultValue(false)
fun self(): Toggle
}

0 comments on commit 98e51ce

Please sign in to comment.