forked from indico/indico-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (149 loc) ยท 5.01 KB
/
build.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
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
name: Build
env:
PYTHON_VERSION: '3.12'
TZ: Europe/Zurich
on:
push:
branches:
- 'master'
- '*.x'
- 'ci-build-plugins' # TODO remove
pull_request:
branches:
- 'master'
- '*.x'
- 'ci-build-plugins' # TODO remove
types:
- opened
- reopened
- synchronize
- labeled
permissions:
contents: read
jobs:
list-plugins:
name: Get plugin list ๐
runs-on: ubuntu-22.04
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'build-wheel')
outputs:
PLUGINS_MATRIX: ${{ steps.list-plugins.outputs.PLUGINS_MATRIX }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ๐
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install deps
run: pip install --user setuptools
- name: Generate matrix
id: list-plugins
env:
PR_NUMBER: ${{ github.event_name == 'pull_request' && github.event.pull_request.number }}
run: python .github/utils/generate_matrix.py
build:
name: Build ${{ matrix.plugin }} ๐
needs: list-plugins
runs-on: ubuntu-22.04
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'build-wheel')
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.list-plugins.outputs.PLUGINS_MATRIX) }}
steps:
- name: Fail build if manifest is invalid
if: matrix.invalid_manifest
run: |
echo ::error::Plugin has invalid manifest
exit 1
- name: Checkout plugins
uses: actions/checkout@v4
with:
path: plugins
# prefer head commit over merge commit in case of PRs
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
- name: Pick Indico core repo
id: core-repo
env:
GH_TOKEN: ${{ github.token }}
PR_BODY: ${{ github.event_name == 'pull_request' && github.event.pull_request.body }}
PR_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref }}
run: python plugins/.github/utils/get_core_repo.py indico/indico INDICO
- name: Checkout core
uses: actions/checkout@v4
with:
path: indico
repository: indico/indico
ref: ${{ steps.core-repo.outputs.INDICO_BRANCH }}
- name: Set up Python ๐
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: |
indico/requirements*.txt
plugins/**/setup.cfg
- name: Setup Node
if: matrix.assets
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: indico/package-lock.json
- name: Install build deps ๐ง
working-directory: indico
run: |
sudo apt-get install libpq-dev
pip install --user -U pip setuptools wheel
pip install --user -e '.[dev]'
- name: Install npm deps โ
if: matrix.assets
working-directory: indico
run: npm ci
- name: Install plugin deps ๐ง
if: matrix.install && matrix.deps != '[]'
working-directory: plugins
run: |
for dep in ${{ join(matrix.deps, ' ') }}; do
pip install --user -e $dep/
done
- name: Install plugin ๐ง
if: matrix.install
working-directory: plugins
run: pip install --user -e ${{ matrix.plugin }}/
# XXX this is already done by build-wheel.py (but w/o react i18n which we don't use in plugins yet)
# - name: Compile translations ๐ดโโ ๏ธ
# if: matrix.i18n
# working-directory: indico
# run: indico i18n compile plugin ../plugins/${{ matrix.plugin }}
- name: Build wheel ๐
working-directory: indico
run: ./bin/maintenance/build-wheel.py plugin ../plugins/${{ matrix.plugin }} --add-version-suffix
- uses: actions/upload-artifact@v4
name: Upload build artifacts ๐ฆ
with:
name: plugin-wheel-${{ matrix.plugin }}
retention-days: 7
path: ./indico/dist
bundle:
name: Bundle all wheels ๐ฆ
needs: build
runs-on: ubuntu-22.04
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'build-wheel')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: plugin-wheel-*
path: dist
- name: List artifacts ๐
run: ls -al dist/
- uses: actions/upload-artifact@v4
name: Upload build artifacts ๐ฆ
with:
name: plugins-wheel
retention-days: 7
path: dist
- name: Delete individual artifacts ๐ฎ
uses: geekyeggo/delete-artifact@v5
with:
name: plugin-wheel-*