forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 1
301 lines (257 loc) · 12.1 KB
/
r-daily.yml
File metadata and controls
301 lines (257 loc) · 12.1 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
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
name: r-daily
on:
push:
branches:
- r-daily-source
jobs:
r-daily-update:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.MY_PAT }}
GITHUB_TOKEN: ${{ secrets.MY_PAT }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
#fetch-depth: 0
token: ${{ secrets.MY_PAT }}
- name: Configure git
run: |
git config --global user.name "Bruno Rodrigues"
git config --global user.email "bruno@brodrigues.co"
- name: Synching fork
run: |
git remote add upstream https://github.com/NixOS/nixpkgs
git checkout r-daily-source
git fetch upstream
git reset --hard upstream/master
#- name: Cherry-pick R bump
# run: |
# set -e
# git fetch upstream
# if git cherry-pick --empty=drop -m 1 a65b87c485e1^..ad0a16337834; then
# echo "Cherry-pick successful"
# else
# echo "Cherry-pick failed — aborting"
# git cherry-pick --abort
# exit 1
# fi
- name: Cherry-pick pypmml PR
run: |
set -e
# Fetch the PR from upstream
git fetch upstream pull/507209/head:pr-507209
# Try cherry-pick
if git cherry-pick pr-507209; then
echo "Cherry-pick successful"
else
echo "Cherry-pick failed, aborting"
git cherry-pick --abort
fi
- name: Cherry-pick fix skl2onnx PR
run: |
set -e
git fetch upstream pull/505958/head
if git cherry-pick 6a4cf18e0b7ba2ee3cf160c8446a95d154a080d0 d31cf4a3206f72382dd5bd5a53917274be56d4d5; then
echo "Cherry-pick successful"
else
echo "Cherry-pick failed, aborting"
git cherry-pick --abort
fi
- name: Cherry-pick skl2onnx PR
run: |
set -e
# Fetch the PR from upstream
git fetch upstream pull/505944/head:pr-505944
# Try cherry-pick
if git cherry-pick pr-505944; then
echo "Cherry-pick successful"
else
echo "Cherry-pick failed, aborting"
git cherry-pick --abort
fi
- name: Cherry-pick jpmml-statsmodels PR
run: |
set -e
# Fetch the PR from upstream
git fetch upstream pull/495154/head:pr-495154
# Try cherry-pick
if git cherry-pick pr-495154; then
echo "Cherry-pick successful"
else
echo "Cherry-pick failed, aborting"
git cherry-pick --abort
fi
- name: Cherry-pick jmmpl_evaluator
run: |
set -e
# Fetch the PR from upstream
git fetch upstream pull/507541/head:pr-507541
# Try cherry-pick
if git cherry-pick pr-507541; then
echo "Cherry-pick successful"
else
echo "Cherry-pick failed, aborting"
git cherry-pick --abort
fi
- name: Updating files
run: |
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/.github/workflows/update-cachix.yml -P .github/workflows/
# start with environments
#wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/r-daily.nix
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/cachix.nix
# get updated files from r-daily branch
#cd pkgs/development/r-modules/
#rm *-packages.json
#wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/cran-packages.json
#wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/bioc-packages.json
#wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/bioc-annotation-packages.json
#wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/bioc-experiment-packages.json
- name: Get ryxpress
run: |
mkdir -p pkgs/development/python-modules/ryxpress
cd pkgs/development/python-modules/ryxpress
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/refs/heads/add_rixpress/pkgs/development/python-modules/ryxpress/default.nix
- name: Get talvez
run: |
mkdir -p pkgs/development/python-modules/talvez
cd pkgs/development/python-modules/talvez
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/refs/heads/add_talvez/pkgs/development/python-modules/talvez/default.nix
- name: Insert ryxpress in python-packages.nix
run: |
FILE="pkgs/top-level/python-packages.nix"
# Insert ryxpress after ryd-client
sed -i '/ryd-client = callPackage .*;/a \
\ ryxpress = callPackage ../development/python-modules/ryxpress { };' "$FILE"
- name: Insert talvez in python-packages.nix
run: |
FILE="pkgs/top-level/python-packages.nix"
# Insert talvez after takethetime
sed -i '/takethetime = callPackage .*;/a \
\ talvez = callPackage ../development/python-modules/talvez { };' "$FILE"
- name: Get patches for Bioc devel
run: |
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/bioc_devel.patch
#- name: Update R to 4.5.3 until merged in master
# run: |
# sed -i 's|hash = "sha256-DXH/cQbsac18Z+HpXtGjzuNViAkx8ut4xTABSp43nyA=";|hash = "sha256-qlwe1Ck8cnGsUT1lRnA1asDopq1eQr4BQ2XREVC1uPI=";|' pkgs/applications/science/math/R/default.nix
# sed -i 's|version = "4.5.2";|version = "4.5.3";|' pkgs/applications/science/math/R/default.nix
- name: Add libuv build input for fs
run: |
sed -i '/rsvg = \[ pkgs.pkg-config \];/a\ fs = [ pkgs.which pkgs.pkg-config pkgs.libuv.dev pkgs.cmake ];' pkgs/development/r-modules/default.nix
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
# ───────────────────────────────────────────────────────────────────────────────
# ▼ NEW STEP: install nix-prefetch-git
- name: Install nix-prefetch-git
run: |
nix profile install nixpkgs#nix-prefetch-git
# ▼ NEW STEP: fetch and patch registry.nix for CodeDownIO/General
- name: Update Julia “General” registry to latest commit
run: |
# 1. Get the latest commit hash from the remote repo:
LATEST_COMMIT=$(
git ls-remote https://github.com/CodeDownIO/General.git HEAD \
| cut -f1
)
echo "Latest commit is $LATEST_COMMIT"
# 2. Prefetch that exact revision and parse JSON to extract just the base32 sha256:
RAW_JSON=$(
nix-prefetch-git https://github.com/CodeDownIO/General.git "$LATEST_COMMIT"
)
SHA=$(echo "$RAW_JSON" | jq -r .sha256)
echo "Computed sha256 (base32) is $SHA"
# 3. In-place replace rev = "…" and sha256 = "…" in registry.nix:
sed -i \
"s|rev = \".*\";|rev = \"$LATEST_COMMIT\";|" \
pkgs/development/julia-modules/registry.nix
sed -i \
"s|sha256 = \".*\";|sha256 = \"$SHA\";|" \
pkgs/development/julia-modules/registry.nix
- name: Bump BiocManager in cran-packages.json
run: |
FILE="pkgs/development/r-modules/cran-packages.json"
sed -i '
/"BiocManager": {/,/}/ {
s|"version": "1\.30\.26"|"version": "1.30.27"|
s|"sha256": ".*"|"sha256": "1dgv0gfa7ff3w96dax8p7jna1bf2652sav2mhn82gj02jvqdrgxc"|
}
' "$FILE"
- name: Check cran-packages.json
run: grep -n -A6 -B1 '"BiocManager":' pkgs/development/r-modules/cran-packages.json
- name: Update R packages
run: |
cd pkgs/development/r-modules/
nix-shell generate-shell.nix --run "Rscript generate-r-packages.R cran > cran-packages.json.new"
nix-shell generate-shell.nix --run "Rscript generate-r-packages.R bioc > bioc-packages.json.new"
nix-shell generate-shell.nix --run "Rscript generate-r-packages.R bioc-annotation > bioc-annotation-packages.json.new"
nix-shell generate-shell.nix --run "Rscript generate-r-packages.R bioc-experiment > bioc-experiment-packages.json.new"
- name: Rename files
run: |
cd pkgs/development/r-modules/
mv cran-packages.json.new cran-packages.json
mv bioc-packages.json.new bioc-packages.json
mv bioc-annotation-packages.json.new bioc-annotation-packages.json
mv bioc-experiment-packages.json.new bioc-experiment-packages.json
- name: Pushing updates
run: |
git checkout -b r-daily
git add .
git commit -m "daily update" || echo "no updated R packages in this period"
git push --force origin r-daily
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Pushing updates to dated branch
run: |
git checkout -b ${{ steps.date.outputs.date }}
git add .
git commit -m "R CRAN and Bioc update" || echo "no updated R packages in this period"
git push --force origin ${{ steps.date.outputs.date }}
# now update for bioc devel
- name: Apply patch
run: git apply bioc_devel.patch
- name: Update R packages
run: |
cd pkgs/development/r-modules/
nix-shell generate-shell.nix --run "Rscript generate-r-packages.R bioc > bioc-packages.json.new"
nix-shell generate-shell.nix --run "Rscript generate-r-packages.R bioc-annotation > bioc-annotation-packages.json.new"
nix-shell generate-shell.nix --run "Rscript generate-r-packages.R bioc-experiment > bioc-experiment-packages.json.new"
- name: Rename files
run: |
cd pkgs/development/r-modules/
mv bioc-packages.json.new bioc-packages.json
mv bioc-annotation-packages.json.new bioc-annotation-packages.json
mv bioc-experiment-packages.json.new bioc-experiment-packages.json
- name: Pushing updates
run: |
git checkout -b r-bioc-devel
git add .
git commit -m "bioc-devel update" || echo "no updated R packages in this period"
git push --force origin r-bioc-devel
- name: Get sha of r-devel
id: r-devel-sha
run: echo "::set-output name=r-devel-sha::$(nix-prefetch-url https://cran.r-project.org/src/base-prerelease/R-devel.tar.gz)"
- name: Patch for R-devel
run: |
sed -i 's|sha256 = ".*";|sha256 = "${{ steps.r-devel-sha.outputs.r-devel-sha }}";|' pkgs/applications/science/math/R/default.nix
sed -i 's|url = "https://cran.r-project.org/src/base/R-.*";|url = "https://cran.r-project.org/src/base-prerelease/R-devel.tar.gz";|' pkgs/applications/science/math/R/default.nix
- name: Pushing updates r-devel-bioc-devel
run: |
git checkout -b r-devel-bioc-devel
git add .
git commit -m "r-devel-bioc-devel update" || echo "no updated R packages in this period"
git push --force origin r-devel-bioc-devel
- name: Pushing updates r-devel
run: |
git checkout r-daily
sed -i 's|sha256 = ".*";|sha256 = "${{ steps.r-devel-sha.outputs.r-devel-sha }}";|' pkgs/applications/science/math/R/default.nix
sed -i 's|url = "https://cran.r-project.org/src/base/R-.*";|url = "https://cran.r-project.org/src/base-prerelease/R-devel.tar.gz";|' pkgs/applications/science/math/R/default.nix
git checkout -b r-devel
git add .
git commit -m "r-devel update" || echo "no updated R packages in this period"
git push --force origin r-devel