Skip to content

Commit

Permalink
Automatic R devel version fix (#89)
Browse files Browse the repository at this point in the history
* rocker PATCHED to devel

* Use date and versions from dcf file to decide when devel should be patched instead

* Devel or patched pre-release based on R version from config.yaml
  • Loading branch information
almahmoud authored Oct 31, 2023
1 parent 5748be5 commit 6e49e6c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/full-rstudio-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,15 @@ jobs:
git clone --depth 1 https://github.com/rocker-org/rocker-versioned2
sed -i 's#rocker/r-ver:${{ steps.defs.outputs.rver }}#${{ steps.defs.outputs.rockerintermediateprefix }}-r-ver:${{ steps.defs.outputs.rver }}-${{ matrix.arch }}#g' rocker-versioned2/dockerfiles/rstudio_${{ steps.defs.outputs.rver }}.Dockerfile
sed -i 's#install_quarto.sh#install_quarto.sh || true#g' rocker-versioned2/dockerfiles/rstudio_${{ steps.defs.outputs.rver }}.Dockerfile
BIOC_MINOR=$(echo "${{ steps.defs.outputs.biocver }}" | awk -F'.' '{print $NF}')
echo "Bioconductor Version: ${{ steps.defs.outputs.biocver }}"
if [ "${{ steps.defs.outputs.rver }}" = "devel" ];
then
if [ $((BIOC_MINOR%2)) -eq 0 ];
then
echo "Using latest release R since Bioc devel version is even";
sed -i 's#R_VERSION=${{ steps.defs.outputs.rver }}#R_VERSION=latest#g' rocker-versioned2/dockerfiles/r-ver_${{ steps.defs.outputs.rver }}.Dockerfile
else
echo "Using latest pre-release R since Bioc devel version is even";
sed -i 's#R_VERSION=${{ steps.defs.outputs.rver }}#R_VERSION=patched#g' rocker-versioned2/dockerfiles/r-ver_${{ steps.defs.outputs.rver }}.Dockerfile
fi
if [ "${{ steps.defs.outputs.rver }}" = "devel" ]; then
echo "Using devel pre-release R since Bioc devel version is odd";
DEVEL_R_VER=$(curl https://bioconductor.org/config.yaml | grep '"${{ steps.defs.outputs.rver }}":' | awk '{print $2}' | sed 's/"//g')
REL_VER=$(curl https://cran.r-project.org/src/base/VERSION-INFO.dcf | grep "$DEVEL_R_VER" | awk -F':' '{print $1}')
# if the matching version is under release rather than devel, use patched pre-release rather than devel pre-release
if [ "$REL_VER" == "Release" ]; then
sed -i 's#R_VERSION=${{ steps.defs.outputs.rver }}#R_VERSION=patched#g' rocker-versioned2/dockerfiles/r-ver_${{ steps.defs.outputs.rver }}.Dockerfile
fi
fi
Expand Down

0 comments on commit 6e49e6c

Please sign in to comment.