Skip to content

Commit

Permalink
Merge branch 'make'
Browse files Browse the repository at this point in the history
  • Loading branch information
jangorecki committed Oct 19, 2024
2 parents 6cf2c62 + 6c897ed commit 85377a5
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
^\.github$
^_litedown\.yml$
^pkgup$
^doc$
^Makefile$
^public$
20 changes: 4 additions & 16 deletions .github/workflows/pkgup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,14 @@ jobs:
- name: build
run: |
echo "Revision:" $GITHUB_SHA >> ./DESCRIPTION
R CMD build .
make build
- name: check
run: |
R CMD check --as-cran --no-manual $(ls -1t pkgup_*.tar.gz | head -n 1)
- name: website
make check
- name: public
if: github.ref == 'refs/heads/master'
run: |
R CMD INSTALL $(ls -1t pkgup_*.tar.gz | head -n 1) ## seems to be required
Rscript -e 'invisible(file.copy("vignettes", "pkgup", recursive=TRUE))'
Rscript -e 'litedown::fuse_site("pkgup")'
mkdir -p public
find pkgup -name '*.html' -print0 | cpio -pvdmB --null public
mv public/pkgup/* public
rm -r public/pkgup
- name: repo
if: github.ref == 'refs/heads/master'
run: |
mkdir -p public/src/contrib
mv $(ls -1t pkgup_*.tar.gz | head -n 1) public/src/contrib
Rscript -e 'tools::write_PACKAGES("public/src/contrib", fields="Revision")'
make public
- name: upload
if: github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v1
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.Rhistory
*.html
pkgup_*.tar.gz
public
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
45 changes: 45 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.PHONY : clean build install doc repo

srcpath = $(wildcard ls -1t pkgup_*.tar.gz | head -n 1)

all:
make clean
make build
make public

clean:
rm -f $(srcpath)
rm -rf pkgup.Rcheck
rm -rf doc .pkgup/doc
rm -rf .pkgup/repo
rm -rf public

build:
R CMD build .

check:
R CMD check --as-cran --no-manual $(srcpath)

install:
R CMD INSTALL $(srcpath)

doc:
rm -rf .pkgup/doc
mkdir -p .pkgup/doc/vignettes
rsync -r --exclude 'doc' --exclude 'repo' .pkgup/* .pkgup/doc/
cp -r vignettes/* .pkgup/doc/vignettes/
Rscript -e 'litedown::fuse_site(".pkgup/doc")'
#ls -aR .pkgup/doc

repo:
rm -rf .pkgup/repo
mkdir -p .pkgup/repo/src/contrib
mv "$(srcpath)" .pkgup/repo/src/contrib
Rscript -e 'tools::write_PACKAGES(".pkgup/repo/src/contrib", fields="Revision")'
#ls -aR .pkgup/repo

public: install doc repo
mkdir -p public
cp -r .pkgup/repo/* public
rsync -ravz --include '*/' --include='*.html' --exclude='*' .pkgup/doc/ public/
#ls -aR public

0 comments on commit 85377a5

Please sign in to comment.