-
Notifications
You must be signed in to change notification settings - Fork 5
246 lines (199 loc) · 7.53 KB
/
build-and-rebuild.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
242
243
244
245
246
name: Building and Rebuilding
on:
push:
# branches:
# - main
pull_request:
workflow_dispatch:
env:
RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: true
# Name of the production database
REPRO_DB_NAME: repro.db
# Set the directory where the docs are stored
# because we try to be local first this needs to
# be explicitly set in CI
REPRO_DOCS_DIR: docs
# For windows builds
PYTHONUTF8: 1
jobs:
# run-tests:
# continue-on-error: false
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - uses: prefix-dev/[email protected]
# with:
# pixi-version: "latest"
# - name: Build rattler-build
# run: |
# pixi run test
setup-rattler-build:
# needs: run-tests
continue-on-error: false
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
- name: Run YAML to Github Output Action
id: read-yaml
uses: nichmor/[email protected]
with:
config: ${{ github.workspace }}/config.yaml
- name: Restore rattler-build cache
id: cache-rattler-build-restore
uses: actions/cache/restore@v4
with:
path: |
.rb-clone/target/release/rattler-build
.rb-clone/target/release/rattler-build.exe
key: v4-${{ runner.os }}-rattler-build-${{ steps.read-yaml.outputs['rattler-build.rev'] }}
- name: Build rattler-build
if: steps.cache-rattler-build-restore.outputs.cache-hit != 'true'
run: |
pixi run repror setup-rattler-build
- name: Save unix rattler-build
uses: actions/cache/save@v4
if: steps.cache-rattler-build-restore.outputs.cache-hit != 'true'
with:
path: |
.rb-clone/target/release/rattler-build
.rb-clone/target/release/rattler-build.exe
key: v4-${{ runner.os }}-rattler-build-${{ steps.read-yaml.outputs['rattler-build.rev'] }}
generate-recipes:
runs-on: macos-latest
needs: setup-rattler-build
outputs:
recipe: ${{ steps.generate-matrix.outputs.recipes }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
- name: Generate matrix
id: generate-matrix
run: |
message="$(pixi r generate-recipes-failed)"
echo "$message"
echo "recipes=$message" >> "$GITHUB_OUTPUT"
env:
LOG_LEVEL: WARNING # Set log level to WARNING
build-and-rebuild-recipes:
needs: generate-recipes
name: ${{ matrix.recipe_name }}-${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
recipe_name: ${{ fromJson(needs.generate-recipes.outputs.recipe) }}
# os: [ubuntu-latest]
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
- name: Run YAML to Github Output Action
id: read-yaml
uses: nichmor/[email protected]
with:
config: ${{ github.workspace }}/config.yaml
- name: Restore rattler-build cache
id: cache-rattler-build-restore
uses: actions/cache/restore@v4
with:
path: |
.rb-clone/target/release/rattler-build
.rb-clone/target/release/rattler-build.exe
key: v4-${{ runner.os }}-rattler-build-${{ steps.read-yaml.outputs['rattler-build.rev'] }}
fail-on-cache-miss: true
- name: Set timezone to UTC
if: matrix.os == 'ubuntu-latest'
run: sudo timedatectl set-timezone UTC
- name: Set timezone to GMT
if: matrix.os == 'macos-latest'
run: sudo systemsetup -settimezone GMT
- name: Set LANG
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: echo "LANG=en_US.UTF-8" >> "$GITHUB_ENV"
- name: Build recipes and track if hash is equal
if: matrix.os != 'windows-latest'
run: |
pixi run repror build-recipe ${{ matrix.recipe_name }} --rattler-build-exe .rb-clone/target/release/rattler-build --patch --actions-url https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Build recipes and track if hash is equal
if: matrix.os == 'windows-latest'
run: |
# shellcheck disable=SC1012
pixi run repror build-recipe ${{ matrix.recipe_name }} --rattler-build-exe .rb-clone\target\release\rattler-build.exe --patch --actions-url https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Set timezone to Los Angeles
if: matrix.os == 'ubuntu-latest'
run: sudo timedatectl set-timezone America/Los_Angeles
- name: Set timezone to Los Angeles
if: matrix.os == 'macos-latest'
run: sudo systemsetup -settimezone America/Los_Angeles
- name: Set LANG
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: echo "LANG=et_EE.UTF-8" >> "$GITHUB_ENV"
- name: Rebuild recipes and track if hash is equal
if: matrix.os != 'windows-latest'
run: |
pixi run rebuild-recipe ${{ matrix.recipe_name }} --rattler-build-exe .rb-clone/target/release/rattler-build --patch --actions-url https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Rebuild recipes and track if hash is equal
if: matrix.os == 'windows-latest'
run: |
# shellcheck disable=SC1012
pixi run rebuild-recipe ${{ matrix.recipe_name }} --rattler-build-exe .rb-clone\target\release\rattler-build.exe --patch --actions-url https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Upload results
uses: actions/upload-artifact@v3
if: always()
with:
name: build-info
path: |
build_info/
ci_artifacts/
recipe_info/
patch-db-and-generate-html:
runs-on: ubuntu-latest
needs: build-and-rebuild-recipes
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
# Cache might be empty
- uses: actions/download-artifact@v3
continue-on-error: true
with:
name: build-info
path: .
- name: list files
continue-on-error: true
run: |
ls -la build_info/
- name: Merge patches and update database, push to remote
if: github.ref == 'refs/heads/main'
run: |
REPROR_UPDATE_TOKEN=${{ secrets.GITHUB_TOKEN }} pixi run repror merge-patches --update-remote
- name: Merge patches and update database
if: github.ref != 'refs/heads/main'
run: |
pixi run repror merge-patches
- name: Generate html and upload to remote
if: github.ref == 'refs/heads/main'
run: |
REPROR_UPDATE_TOKEN=${{ secrets.GITHUB_TOKEN }} pixi run repror generate-html --update-remote
- name: Generate html
if: github.ref != 'refs/heads/main'
run: |
pixi run repror generate-html