-
Notifications
You must be signed in to change notification settings - Fork 929
96 lines (83 loc) · 3.86 KB
/
release_create_task.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Release - Create Release Task in Asana
on:
workflow_dispatch:
inputs:
app-version:
description: 'App Version for Release'
required: true
default: 'PLACEHOLDER'
env:
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}
emoji_start: ":flight_departure:" # 🛫
emoji_info: ":information_source:" # ℹ️
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
create_release_task:
name: Create Android App Release Task in Asana
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check app-version value
run: |
if [ "${{ github.event.inputs.app-version }}" == "PLACEHOLDER" ]; then
echo "Input value cannot be 'PLACEHOLDER'."
exit 1
else
echo "Input value is valid: ${{ github.event.inputs.app-version }}"
fi
- name: Install Release Bridge from Homebrew
run: |
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
- name: Assign task to Github Actor
id: assign-release-task
uses: ./.github/actions/assign-release-task
with:
task_name: 'Android Release ${{ github.event.inputs.app-version }}'
asana_token: ${{ secrets.GH_ASANA_SECRET }}
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]
with:
asana-pat: ${{ secrets.GH_ASANA_SECRET }}
asana-project: ${{ vars.GH_ANDROID_APP_PROJECT_ID }}
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'
- 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'