Skip to content

Update cachix.nix

Update cachix.nix #78

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: 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