Skip to content

Replace the app label with a horizontal divider #65

Replace the app label with a horizontal divider

Replace the app label with a horizontal divider #65

name: Release - Create Release Task in Asana

Check failure on line 1 in .github/workflows/release_create_task.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release_create_task.yml

Invalid workflow file

(Line: 7, Col: 9): Required property is missing: type
on:
workflow_call:
inputs:
app-version:
description: 'App Version for Release'
required: true
workflow_dispatch:
inputs:
app-version:
description: 'App Version for Release'
required: true
default: 'PLACEHOLDER'
env:
ASANA_PAT: ${{ secrets.ASANA_ACCESS_TOKEN }}
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.ASANA_ACCESS_TOKEN }}
project_gid: ${{ vars.GH_ANDROID_RELEASE_BOARD_PROJECT_ID }}
username: ${{ github.actor }}
- name: Read Task ID from file and set as output
id: read_task_output_step
run: |
OUTPUT_FILE="${{ github.workspace }}/asana_task_id.txt"
echo "Attempting to read Task ID from file: $OUTPUT_FILE"
if [ -f "$OUTPUT_FILE" ]; then
TASK_ID_VALUE=$(cat "$OUTPUT_FILE")
echo "Raw content from file: '$TASK_ID_VALUE'"
# Check for error markers
if [[ "$TASK_ID_VALUE" == "TASK_NOT_FOUND" || "$TASK_ID_VALUE" == "USER_MAPPING_FILE_NOT_FOUND" || "$TASK_ID_VALUE" == "USER_NOT_IN_MAPPING" ]]; then
echo "::error::Error marker found in output file: $TASK_ID_VALUE"
echo "task_id=" >> $GITHUB_OUTPUT # Set actual output to empty on error
else
echo "Successfully read Task ID: '$TASK_ID_VALUE'"
echo "task_id=$TASK_ID_VALUE" >> $GITHUB_OUTPUT
fi
else
echo "::error::Output file $OUTPUT_FILE not found!"
echo "task_id=" >> $GITHUB_OUTPUT # Set actual output to empty if file not found
fi
- name: Get Asana Task Permalink
id: get-task-permalink
uses: duckduckgo/[email protected]
with:
asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
asana-task-id: ${{ steps.read_task_output_step.outputs.task_id }}
action: 'get-asana-task-permalink'
- 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 task created successfully ${{ steps.get-task-permalink.outputs.asanaTaskPermalink }}
action: 'send-mattermost-message'
- name: Create Asana task when workflow failed
if: ${{ failure() }}
uses: duckduckgo/[email protected]
with:
asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
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'