-
Notifications
You must be signed in to change notification settings - Fork 0
241 lines (240 loc) · 6.45 KB
/
main.yaml
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# Project's main software development workflow.
name: 'Workflow'
run-name: '${{ github.event_name }}: ${{ github.ref }}'
on:
issues:
types:
- opened
- edited
- labeled
- assigned
- unassigned
- unlabeled
- locked
- unlocked
issue_comment:
types:
- created
- edited
pull_request:
types:
- assigned
- auto_merge_disabled
- auto_merge_enabled
- closed
- converted_to_draft
- demilestoned
- dequeued
- edited
- enqueued
- labeled
- locked
- milestoned
- opened
- ready_for_review
- reopened
- review_request_removed
- review_requested
- synchronize
- unassigned
- unlabeled
- unlocked
pull_request_target:
types:
- opened
push:
schedule:
- cron: '43 23 * * *' # Every day at 23:43 UTC.
- cron: '43 6 * * 6' # Every Saturday at 6:43 UTC.
workflow_dispatch:
inputs:
cca:
description: CCA
type: choice
options:
- disabled
- report
- pull
- merge
- commit
- amend
default: disabled
required: true
refactor:
description: Refactoring
type: choice
options:
- disabled
- report
- pull
- merge
- commit
- amend
default: disabled
required: true
web:
description: Website
type: choice
options:
- disabled
- build
- deploy
default: disabled
required: true
build:
description: Build
type: boolean
default: false
required: true
test:
description: Test
type: boolean
default: false
required: true
release:
description: Release v1
type: boolean
default: false
required: true
jobs:
main:
name: Project
# Run 'pull_request_target' only for pulls from forks.
if: >-
(
github.event_name != 'pull_request_target'
|| github.event.pull_request.head.repo.full_name != github.repository
) && (
github.event_name != 'push'
|| (github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch)
)
uses: ./.github/workflows/manager.yaml
permissions:
contents: write
issues: write
pull-requests: write
secrets:
repo-admin-token: ${{ secrets.REPO_ADMIN_TOKEN }}
zenodo-token: ${{ secrets.ZENODO_TOKEN }}
zenodo-sandbox-token: ${{ secrets.ZENODO_SANDBOX_TOKEN }}
web:
name: ${{ matrix.config.name }}
needs: main
if: fromJSON(needs.main.outputs.web)
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.main.outputs.web) }}
permissions:
pages: write
id-token: write
uses: ./.github/workflows/cicd-web.yaml
with:
config: ${{ toJSON(matrix.config.job) }}
lint:
name: ${{ matrix.config.name }}
needs: main
if: fromJSON(needs.main.outputs.lint)
permissions:
pull-requests: write
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.main.outputs.lint) }}
uses: ./.github/workflows/ci-lint.yaml
with:
config: ${{ toJSON(matrix.config.job) }}
test:
name: ${{ matrix.config.name }}
needs: main
if: fromJSON(needs.main.outputs.test)
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.main.outputs.test) }}
uses: ./.github/workflows/ci-test.yaml
with:
config: ${{ toJSON(matrix.config.job) }}
build:
name: ${{ matrix.config.name }}
needs: main
if: fromJSON(needs.main.outputs.build)
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.main.outputs.build) }}
uses: ./.github/workflows/ci-build.yaml
with:
config: ${{ toJSON(matrix.config.job) }}
cm-anaconda:
name: Anaconda Maintenance
needs: [ main ]
if: fromJSON(needs.main.outputs.cm-anaconda)
uses: ./.github/workflows/cm-anaconda.yaml
secrets:
anaconda-token: ${{ secrets.ANACONDA_TOKEN }}
with:
config: ${{ needs.main.outputs.cm-anaconda }}
binder:
name: ${{ matrix.config.name }}
needs: [main, web, lint, test, build]
if: fromJSON(needs.main.outputs.binder)
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.main.outputs.binder) }}
uses: ./.github/workflows/cicd-binder.yaml
permissions:
contents: read
packages: write
attestations: write
id-token: write
secrets:
container-registry-token: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
with:
config: ${{ toJSON(matrix.config.job) }}
publish-testpypi:
name: ${{ fromJSON(needs.main.outputs.publish-testpypi).name }}
needs: [main, web, lint, test, build]
if: fromJSON(needs.main.outputs.publish-testpypi)
permissions:
id-token: write
uses: ./.github/workflows/cd-pypi.yaml
with:
config: ${{ toJSON(fromJSON(needs.main.outputs.publish-testpypi).job) }}
publish-anaconda:
name: ${{ fromJSON(needs.main.outputs.publish-anaconda).name }}
needs: [ main, web, lint, test, build ]
if: fromJSON(needs.main.outputs.publish-anaconda)
uses: ./.github/workflows/cd-anaconda.yaml
secrets:
anaconda-token: ${{ secrets.ANACONDA_TOKEN }}
with:
config: ${{ toJSON(fromJSON(needs.main.outputs.publish-anaconda).job) }}
publish-pypi:
name: ${{ fromJSON(needs.main.outputs.publish-pypi).name }}
needs: [ main, publish-testpypi ]
if: fromJSON(needs.main.outputs.publish-pypi)
permissions:
id-token: write
uses: ./.github/workflows/cd-pypi.yaml
with:
config: ${{ toJSON(fromJSON(needs.main.outputs.publish-pypi).job) }}
release:
name: ${{ fromJSON(needs.main.outputs.release).name }}
needs: [ main, web, lint, test, build, publish-pypi ]
if: ${{ !cancelled() && !failure() && fromJSON(needs.main.outputs.release) }}
permissions:
contents: write
discussions: write
uses: ./.github/workflows/cd-github-zenodo.yaml
with:
config: ${{ toJSON(fromJSON(needs.main.outputs.release).job) }}
secrets:
zenodo-token: ${{ secrets.ZENODO_TOKEN }}
zenodo-sandbox-token: ${{ secrets.ZENODO_SANDBOX_TOKEN }}