Skip to content

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

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

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

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: Cherry-pick R bump
# run: |
# set -e
# git fetch upstream
# if git cherry-pick --empty=drop -m 1 a65b87c485e1^..ad0a16337834; then
# echo "Cherry-pick successful"
# else
# echo "Cherry-pick failed — aborting"
# git cherry-pick --abort
# exit 1
# fi
- name: Cherry-pick pypmml PR
run: |
set -e
# Fetch the PR from upstream
git fetch upstream pull/507209/head:pr-507209
# Try cherry-pick
if git cherry-pick pr-507209; then
echo "Cherry-pick successful"
else
echo "Cherry-pick failed, aborting"
git cherry-pick --abort
fi
- name: Cherry-pick fix skl2onnx PR
run: |
set -e
git fetch upstream pull/505958/head
if git cherry-pick 6a4cf18e0b7ba2ee3cf160c8446a95d154a080d0 d31cf4a3206f72382dd5bd5a53917274be56d4d5; then
echo "Cherry-pick successful"
else
echo "Cherry-pick failed, aborting"
git cherry-pick --abort
fi
- name: Cherry-pick skl2onnx PR
run: |
set -e
# Fetch the PR from upstream
git fetch upstream pull/505944/head:pr-505944
# Try cherry-pick
if git cherry-pick pr-505944; then
echo "Cherry-pick successful"
else
echo "Cherry-pick failed, aborting"
git cherry-pick --abort
fi
- name: Cherry-pick jpmml-statsmodels PR
run: |
set -e
# Fetch the PR from upstream
git fetch upstream pull/495154/head:pr-495154
# Try cherry-pick
if git cherry-pick pr-495154; then
echo "Cherry-pick successful"
else
echo "Cherry-pick failed, aborting"
git cherry-pick --abort
fi
- name: Cherry-pick jmmpl_evaluator
run: |
set -e
# Fetch the PR from upstream
git fetch upstream pull/507541/head:pr-507541
# Try cherry-pick
if git cherry-pick pr-507541; then
echo "Cherry-pick successful"
else
echo "Cherry-pick failed, aborting"
git cherry-pick --abort
fi
- 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 ryxpress
run: |
mkdir -p pkgs/development/python-modules/ryxpress
cd pkgs/development/python-modules/ryxpress
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/refs/heads/add_rixpress/pkgs/development/python-modules/ryxpress/default.nix
- name: Get talvez
run: |
mkdir -p pkgs/development/python-modules/talvez
cd pkgs/development/python-modules/talvez
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/refs/heads/add_talvez/pkgs/development/python-modules/talvez/default.nix
- name: Insert ryxpress in python-packages.nix
run: |
FILE="pkgs/top-level/python-packages.nix"
# Insert ryxpress after ryd-client
sed -i '/ryd-client = callPackage .*;/a \
\ ryxpress = callPackage ../development/python-modules/ryxpress { };' "$FILE"
- name: Insert talvez in python-packages.nix
run: |
FILE="pkgs/top-level/python-packages.nix"
# Insert talvez after takethetime
sed -i '/takethetime = callPackage .*;/a \
\ talvez = callPackage ../development/python-modules/talvez { };' "$FILE"
- 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.5.3 until merged in master
# run: |
# sed -i 's|hash = "sha256-DXH/cQbsac18Z+HpXtGjzuNViAkx8ut4xTABSp43nyA=";|hash = "sha256-qlwe1Ck8cnGsUT1lRnA1asDopq1eQr4BQ2XREVC1uPI=";|' pkgs/applications/science/math/R/default.nix
# sed -i 's|version = "4.5.2";|version = "4.5.3";|' pkgs/applications/science/math/R/default.nix
- name: Add libuv build input for fs
run: |
sed -i '/rsvg = \[ pkgs.pkg-config \];/a\ fs = [ pkgs.which pkgs.pkg-config pkgs.libuv.dev pkgs.cmake ];' pkgs/development/r-modules/default.nix
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
# ───────────────────────────────────────────────────────────────────────────────
# ▼ NEW STEP: install nix-prefetch-git
- name: Install nix-prefetch-git
run: |
nix profile install nixpkgs#nix-prefetch-git
# ▼ NEW STEP: fetch and patch registry.nix for CodeDownIO/General
- name: Update Julia “General” registry to latest commit
run: |
# 1. Get the latest commit hash from the remote repo:
LATEST_COMMIT=$(
git ls-remote https://github.com/CodeDownIO/General.git HEAD \
| cut -f1
)
echo "Latest commit is $LATEST_COMMIT"
# 2. Prefetch that exact revision and parse JSON to extract just the base32 sha256:
RAW_JSON=$(
nix-prefetch-git https://github.com/CodeDownIO/General.git "$LATEST_COMMIT"
)
SHA=$(echo "$RAW_JSON" | jq -r .sha256)
echo "Computed sha256 (base32) is $SHA"
# 3. In-place replace rev = "…" and sha256 = "…" in registry.nix:
sed -i \
"s|rev = \".*\";|rev = \"$LATEST_COMMIT\";|" \
pkgs/development/julia-modules/registry.nix
sed -i \
"s|sha256 = \".*\";|sha256 = \"$SHA\";|" \
pkgs/development/julia-modules/registry.nix
- name: Bump BiocManager in cran-packages.json
run: |
FILE="pkgs/development/r-modules/cran-packages.json"
sed -i '
/"BiocManager": {/,/}/ {
s|"version": "1\.30\.26"|"version": "1.30.27"|
s|"sha256": ".*"|"sha256": "1dgv0gfa7ff3w96dax8p7jna1bf2652sav2mhn82gj02jvqdrgxc"|
}
' "$FILE"
- name: Check cran-packages.json
run: grep -n -A6 -B1 '"BiocManager":' pkgs/development/r-modules/cran-packages.json
- 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