From 2ef42a8fdbffca002307dc92647ef3f79bd8bdf1 Mon Sep 17 00:00:00 2001 From: jangorecki Date: Wed, 20 Sep 2023 18:01:06 +0200 Subject: [PATCH 1/6] setup pkgup for data.table --- .github/workflows/pkgup.yaml | 65 ++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/pkgup.yaml diff --git a/.github/workflows/pkgup.yaml b/.github/workflows/pkgup.yaml new file mode 100644 index 000000000..3771c2001 --- /dev/null +++ b/.github/workflows/pkgup.yaml @@ -0,0 +1,65 @@ +# permissions and concurrency settings for GitHub Pages +permissions: + contents: read + pages: write + id-token: write +concurrency: + group: "pages" + cancel-in-progress: true + +on: [push] +jobs: + build: + name: data.table + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: r-lib/actions/setup-pandoc@v2 + - uses: r-lib/actions/setup-r@v2 + - name: cache-r-dependencies + uses: actions/cache@v3 + with: + path: ${{ env.R_LIBS_USER }}/* + key: library-cache-${{ github.run_id }} + restore-keys: library-cache + - name: setup-r-dependencies + run: | + Rscript -e 'stopifnot(file.copy("DESCRIPTION", file.path(tdir<-tempdir(), "PACKAGES"))); db<-available.packages(paste0("file://", tdir)); deps<-setdiff(tools::package_dependencies(read.dcf("DESCRIPTION", fields="Package")[[1L]], db, which="most")[[1L]], installed.packages(priority="high")[,"Package"]); if (length(deps)) { ap<-available.packages()[,"Version"]; ap<-ap[names(ap) %in% deps]; if (!all(deps%in%names(ap))) stop("dependencies are not avaiable in repository: ",paste(setdiff(deps, names(ap)), collapse=", ")); ip<-installed.packages()[,"Version"]; ip<-ip[names(ip) %in% deps]; pkgs<-ap[deps]>ip[deps]; install.packages(names(pkgs[pkgs|is.na(pkgs)]), INSTALL_opts="--html") }' + - name: build + run: | + R CMD build . + - name: check + run: | + R CMD check --as-cran --no-manual $(ls -1t data.table_*.tar.gz | head -n 1) + - name: manual + if: github.ref == 'refs/heads/master' + run: | + cp -R ${{ env.R_LIBS_USER }} library + R_LIBS_USER="library" R CMD INSTALL $(ls -1t data.table_*.tar.gz | head -n 1) --html + mkdir -p doc/html + cp /usr/share/R/doc/html/{left.jpg,up.jpg,Rlogo.svg,R.css,index.html} doc/html + Rscript -e 'utils::make.packages.html("library", docdir="doc")' + sed -i "s|file://|../..|g" doc/html/packages.html + mkdir -p public + mv doc public/doc + cp -r --parents library/*/{html,help,doc,demo,DESCRIPTION,README,NEWS,README.md,NEWS.md} public 2>/dev/null || : + sed -i 's|"/doc/html/|"/data.table/doc/html/|g' public/library/data.table/doc/index.html 2>/dev/null || : + echo '\nHTTP redirect' > public/index.html + - name: repo + if: github.ref == 'refs/heads/master' + run: | + mkdir -p public/src/contrib + mv $(ls -1t data.table_*.tar.gz | head -n 1) public/src/contrib + Rscript -e 'tools::write_PACKAGES("public/src/contrib")' + - name: upload + if: github.ref == 'refs/heads/master' + uses: actions/upload-pages-artifact@v1 + with: + path: "public" + - name: deploy + if: github.ref == 'refs/heads/master' + id: deployment + uses: actions/deploy-pages@v1 From 7035fd790b25cf01be47b939b18ca93f7b1990a3 Mon Sep 17 00:00:00 2001 From: jangorecki Date: Thu, 21 Sep 2023 09:23:22 +0200 Subject: [PATCH 2/6] add curl os dep --- .github/workflows/pkgup.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pkgup.yaml b/.github/workflows/pkgup.yaml index 3771c2001..ce9059cc0 100644 --- a/.github/workflows/pkgup.yaml +++ b/.github/workflows/pkgup.yaml @@ -25,6 +25,9 @@ jobs: path: ${{ env.R_LIBS_USER }}/* key: library-cache-${{ github.run_id }} restore-keys: library-cache + - name: setup-os-dependencies + run: | + sudo apt-get install -y libcurl4-openssl-dev - name: setup-r-dependencies run: | Rscript -e 'stopifnot(file.copy("DESCRIPTION", file.path(tdir<-tempdir(), "PACKAGES"))); db<-available.packages(paste0("file://", tdir)); deps<-setdiff(tools::package_dependencies(read.dcf("DESCRIPTION", fields="Package")[[1L]], db, which="most")[[1L]], installed.packages(priority="high")[,"Package"]); if (length(deps)) { ap<-available.packages()[,"Version"]; ap<-ap[names(ap) %in% deps]; if (!all(deps%in%names(ap))) stop("dependencies are not avaiable in repository: ",paste(setdiff(deps, names(ap)), collapse=", ")); ip<-installed.packages()[,"Version"]; ip<-ip[names(ip) %in% deps]; pkgs<-ap[deps]>ip[deps]; install.packages(names(pkgs[pkgs|is.na(pkgs)]), INSTALL_opts="--html") }' From de1ce171c59d9640129bc1ddb7327a4ec274bb45 Mon Sep 17 00:00:00 2001 From: jangorecki Date: Fri, 3 Nov 2023 08:14:16 +0100 Subject: [PATCH 3/6] no need for env var --- .github/workflows/pkgup.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgup.yaml b/.github/workflows/pkgup.yaml index ce9059cc0..c58d1713c 100644 --- a/.github/workflows/pkgup.yaml +++ b/.github/workflows/pkgup.yaml @@ -41,7 +41,7 @@ jobs: if: github.ref == 'refs/heads/master' run: | cp -R ${{ env.R_LIBS_USER }} library - R_LIBS_USER="library" R CMD INSTALL $(ls -1t data.table_*.tar.gz | head -n 1) --html + R CMD INSTALL --library="library" $(ls -1t data.table_*.tar.gz | head -n 1) --html mkdir -p doc/html cp /usr/share/R/doc/html/{left.jpg,up.jpg,Rlogo.svg,R.css,index.html} doc/html Rscript -e 'utils::make.packages.html("library", docdir="doc")' From 3216686b868d953addbec8283c957741cb31ce59 Mon Sep 17 00:00:00 2001 From: jangorecki Date: Fri, 3 Nov 2023 08:53:47 +0100 Subject: [PATCH 4/6] add Revision field --- .github/workflows/pkgup.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pkgup.yaml b/.github/workflows/pkgup.yaml index c58d1713c..8d7d8adcb 100644 --- a/.github/workflows/pkgup.yaml +++ b/.github/workflows/pkgup.yaml @@ -33,6 +33,7 @@ jobs: Rscript -e 'stopifnot(file.copy("DESCRIPTION", file.path(tdir<-tempdir(), "PACKAGES"))); db<-available.packages(paste0("file://", tdir)); deps<-setdiff(tools::package_dependencies(read.dcf("DESCRIPTION", fields="Package")[[1L]], db, which="most")[[1L]], installed.packages(priority="high")[,"Package"]); if (length(deps)) { ap<-available.packages()[,"Version"]; ap<-ap[names(ap) %in% deps]; if (!all(deps%in%names(ap))) stop("dependencies are not avaiable in repository: ",paste(setdiff(deps, names(ap)), collapse=", ")); ip<-installed.packages()[,"Version"]; ip<-ip[names(ip) %in% deps]; pkgs<-ap[deps]>ip[deps]; install.packages(names(pkgs[pkgs|is.na(pkgs)]), INSTALL_opts="--html") }' - name: build run: | + echo "Revision:" $GITHUB_SHA >> ./DESCRIPTION R CMD build . - name: check run: | From ff677382d287761483bd882b587225205cffffce Mon Sep 17 00:00:00 2001 From: jangorecki Date: Fri, 3 Nov 2023 11:30:19 +0100 Subject: [PATCH 5/6] missing Revision field during CRAN repo setup --- .github/workflows/pkgup.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgup.yaml b/.github/workflows/pkgup.yaml index 8d7d8adcb..758249e7f 100644 --- a/.github/workflows/pkgup.yaml +++ b/.github/workflows/pkgup.yaml @@ -57,7 +57,7 @@ jobs: run: | mkdir -p public/src/contrib mv $(ls -1t data.table_*.tar.gz | head -n 1) public/src/contrib - Rscript -e 'tools::write_PACKAGES("public/src/contrib")' + Rscript -e 'tools::write_PACKAGES("public/src/contrib", fields="Revision")' - name: upload if: github.ref == 'refs/heads/master' uses: actions/upload-pages-artifact@v1 From e5ca6c979e5fb51f2fea85c525f1e45a05a8e3da Mon Sep 17 00:00:00 2001 From: jangorecki Date: Fri, 3 Nov 2023 11:38:48 +0100 Subject: [PATCH 6/6] no need website --- .github/workflows/pkgup.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pkgup.yaml b/.github/workflows/pkgup.yaml index 758249e7f..d1064cc41 100644 --- a/.github/workflows/pkgup.yaml +++ b/.github/workflows/pkgup.yaml @@ -51,7 +51,6 @@ jobs: mv doc public/doc cp -r --parents library/*/{html,help,doc,demo,DESCRIPTION,README,NEWS,README.md,NEWS.md} public 2>/dev/null || : sed -i 's|"/doc/html/|"/data.table/doc/html/|g' public/library/data.table/doc/index.html 2>/dev/null || : - echo '\nHTTP redirect' > public/index.html - name: repo if: github.ref == 'refs/heads/master' run: |