Update from https://github.com/b-rodrigues/trigger-r-updates/commit/9… #930
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |