Skip to content

Update from https://github.com/b-rodrigues/trigger-r-updates/commit/c… #128

Update from https://github.com/b-rodrigues/trigger-r-updates/commit/c…

Update from https://github.com/b-rodrigues/trigger-r-updates/commit/c… #128

Workflow file for this run

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: Change Bioconductor mirror
run: sed -i 's|http://bioconductor\.statistik\.tu-dortmund\.de/packages/|http://bioconductor.org/packages/|g' pkgs/development/r-modules/generate-r-packages.R
- name: Updating files
run: |
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily-source/.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.nix
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/cran-packages.nix
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/bioc-packages.nix
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/bioc-annotation-packages.nix
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/bioc-experiment-packages.nix
- 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: 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