Release - Create Release Task in Asana #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |