forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 2.95 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
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: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
- name: Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build development environment
run: |
nix-build r-daily.nix
- 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 origin
# in case of conflict, commit this next line, and follow instructions in the next comment two lines below
git merge origin/r-daily
git fetch upstream
# in case of conflict, uncomment the next 5 lines and comment the last
#git checkout upstream/master -- pkgs/development/r-modules/default.nix
#git checkout upstream/master -- pkgs/development/r-modules/cran-packages.nix
#git checkout upstream/master -- pkgs/development/r-modules/bioc-packages.nix
#git checkout upstream/master -- pkgs/development/r-modules/bioc-annotation-packages.nix
#git checkout upstream/master -- pkgs/development/r-modules/bioc-experiment-packages.nix
git merge upstream/master
- name: Update R packages
run: |
nix-shell r-daily.nix --run "cd pkgs/development/r-modules/ && Rscript generate-r-packages.R cran > cran-packages.nix.new"
nix-shell r-daily.nix --run "cd pkgs/development/r-modules/ && Rscript generate-r-packages.R bioc > bioc-packages.nix.new"
nix-shell r-daily.nix --run "cd pkgs/development/r-modules/ && Rscript generate-r-packages.R 'bioc-annotation' > bioc-annotation-packages.nix.new"
nix-shell r-daily.nix --run "cd pkgs/development/r-modules/ && Rscript generate-r-packages.R 'bioc-experiment' > bioc-experiment-packages.nix.new"
- name: Rename files
run: |
cd pkgs/development/r-modules/
mv cran-packages.nix.new cran-packages.nix
mv bioc-packages.nix.new bioc-packages.nix
mv bioc-annotation-packages.nix.new bioc-annotation-packages.nix
mv bioc-experiment-packages.nix.new bioc-experiment-packages.nix
- 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