-
Notifications
You must be signed in to change notification settings - Fork 988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup pkgup GH actions workflow #5690
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2ef42a8
setup pkgup for data.table
jangorecki 7035fd7
add curl os dep
jangorecki de1ce17
no need for env var
jangorecki 3216686
add Revision field
jangorecki ff67738
missing Revision field during CRAN repo setup
jangorecki e5ca6c9
no need website
jangorecki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# 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-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") }' | ||
- name: build | ||
run: | | ||
echo "Revision:" $GITHUB_SHA >> ./DESCRIPTION | ||
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 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")' | ||
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 || : | ||
- 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", fields="Revision")' | ||
- 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a glance one might confuse pkgdown/pkgup as being closely related, maybe rename this workflow e.g. 'upload-pkg-binary'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is pkg sources only, and pkgup stands for putting a package up. I will document CI once we finish releasing to CRAN, so it will be clear.