-
Notifications
You must be signed in to change notification settings - Fork 1.4k
143 lines (127 loc) · 4.71 KB
/
Copy pathnightly-orchestrator.yml
File metadata and controls
143 lines (127 loc) · 4.71 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Generate LGC if release blocking checks are successful
on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
resolve-commit:
name: Resolve commit SHA
runs-on: android-large-runner
outputs:
commit_sha: ${{ steps.resolve.outputs.commit_sha }}
steps:
- name: Resolve commit SHA
id: resolve
run: |
echo "Using commit: ${{ github.sha }}"
echo "commit_sha=${{ github.sha }}" >> $GITHUB_OUTPUT
call-nightly:
needs: resolve-commit
uses: ./.github/workflows/nightly.yml
with:
commit: ${{ needs.resolve-commit.outputs.commit_sha }}
secrets: inherit
call-end-to-end:
needs: [resolve-commit, call-nightly]
uses: ./.github/workflows/e2e-nightly-full-suite.yml
with:
commit: ${{ needs.resolve-commit.outputs.commit_sha }}
secrets: inherit
call-privacy:
needs: [ resolve-commit, call-end-to-end ]
uses: ./.github/workflows/privacy.yml
with:
commit: ${{ needs.resolve-commit.outputs.commit_sha }}
secrets: inherit
call-update-content-scope:
needs: [ resolve-commit, call-privacy ]
uses: ./.github/workflows/update-content-scope.yml
with:
commit: ${{ needs.resolve-commit.outputs.commit_sha }}
secrets: inherit
call-update-ref-tests:
needs: [ resolve-commit, call-update-content-scope ]
uses: ./.github/workflows/update-ref-tests.yml
with:
commit: ${{ needs.resolve-commit.outputs.commit_sha }}
secrets: inherit
tag_lgc_when_successful:
name: Tag last good commit when successful
runs-on: ubuntu-latest
needs: [ resolve-commit, call-nightly, call-end-to-end, call-privacy, call-update-content-scope, call-update-ref-tests]
if: ${{ success() }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ needs.resolve-commit.outputs.commit_sha }}
fetch-depth: 0
submodules: recursive
- name: Set up git config
run: |
git remote set-url origin https://${{ secrets.GT_DAXMOBILE }}@github.com/duckduckgo/Android.git/
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Create tag
run: |
TAG_NAME="LGC-$(date -u +'%Y-%m-%dT%H%M%S')"
git tag "$TAG_NAME"
git push origin "$TAG_NAME"
collect_lgc_tasks:
name: Collect Asana tasks since last release
runs-on: ubuntu-latest
needs: [ resolve-commit, tag_lgc_when_successful ]
if: ${{ success() }}
outputs:
task_ids: ${{ steps.collect.outputs.task_ids }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ needs.resolve-commit.outputs.commit_sha }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/release/requirements.txt
- name: Collect task IDs
id: collect
run: |
TASK_IDS=$(python ./scripts/release/collect-lgc-asana-tasks.py \
--android-repo-path . \
--end-commit '${{ needs.resolve-commit.outputs.commit_sha }}' \
--trigger-phrase 'Task/Issue URL:')
echo "task_ids=$TASK_IDS" >> $GITHUB_OUTPUT
move_tasks_in_lgc:
name: Tag tasks as LGC
runs-on: ubuntu-latest
needs: [ collect_lgc_tasks ]
if: ${{ success() && needs.collect_lgc_tasks.outputs.task_ids != '[]' }}
strategy:
matrix:
task_id: ${{ fromJson(needs.collect_lgc_tasks.outputs.task_ids) }}
fail-fast: false
max-parallel: 1
steps:
- name: Add task to project (no-op if already there)
uses: duckduckgo/native-github-asana-sync@v2.5.1
with:
asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
asana-project: ${{ vars.GH_ANDROID_RELEASE_BOARD_PROJECT_ID }}
asana-section: ${{ vars.GH_ANDROID_RELEASE_BOARD_WAITING_FOR_RELEASE_SECTION_ID }}
asana-task-id: ${{ matrix.task_id }}
action: 'add-task-asana-project'
- name: Tag task as LGC
uses: duckduckgo/native-github-asana-sync@v2.5.1
with:
asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
asana-task-id: ${{ matrix.task_id }}
asana-task-custom-fields: '{"${{ vars.GH_ANDROID_RELEASE_BOARD_RELEASE_STATUS_FIELD_KEY_ID }}":"${{ vars.GH_ANDROID_RELEASE_BOARD_RELEASE_STATUS_FIELD_CONTAINED_IN_LGC_VALUE_ID }}"}'
action: 'update-task-custom-fields'