forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (150 loc) · 7.64 KB
/
r-daily.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
168
169
170
171
172
173
174
175
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: Fix for S4Vectors (only for darwin, https://github.com/Bioconductor/S4Vectors/commit/31853e4e97ff6bc3a8a2e0fdcc6dde72fb61c045) and sf, terra, vap our
# run: |
# sed -i '/flowClust = old/a \
# S4Vectors = old.S4Vectors.overrideAttrs (attrs: {\
# hardeningDisable = [ "format" ];\
# });\
# S4Arrays = old.S4Arrays.overrideAttrs (attrs: {\
# hardeningDisable = [ "format" ];\
# });\
# XVector = old.XVector.overrideAttrs (attrs: {\
# hardeningDisable = [ "format" ];\
# });\
# SparseArray = old.SparseArray.overrideAttrs (attrs: {\
# hardeningDisable = [ "format" ];\
# });\
# Rsamtools = old.Rsamtools.overrideAttrs (attrs: {\
# hardeningDisable = [ "format" ];\
# });\
# rtracklayer = old.rtracklayer.overrideAttrs (attrs: {\
# hardeningDisable = [ "format" ];\
# });\
# VariantAnnotation = old.VariantAnnotation.overrideAttrs (attrs: {\
# hardeningDisable = [ "format" ];\
# });\
# ' pkgs/development/r-modules/default.nix
- 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 patches for Bioc devel
run: |
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/bioc_devel.patch
- name: Update R to 4.4.3 until merged in master
run: |
sed -i 's|sha256 = "sha256-FXjNYD6NhmtYdD5J2L+ZxWnoEHm2pgzzPN973/64F+w=";|sha256 = "sha256-DZPSJEQt6iU8KwhvCI220NPP2bWSzVSW6MshQ+kPyeg=";|' pkgs/applications/science/math/R/default.nix
sed -i 's|version = "4.4.2";|version = "4.4.3";|' pkgs/applications/science/math/R/default.nix
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
- 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