Skip to content
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

Add minimize-man-figures: true to routine.yaml #15

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/routine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
type: boolean
default: true
required: false
minimize-man-figures:
schloerke marked this conversation as resolved.
Show resolved Hide resolved
type: boolean
default: true
required: false
# secrets:
# token:
# required: true
Expand Down Expand Up @@ -101,6 +105,20 @@ jobs:
git add -A man/ || echo "No changes found in man/"
git commit -m '`devtools::document()` (GitHub Actions)' || echo "No documentation changes to commit"

- name: Find `man/figures`
id: man-figures
shell: Rscript {0}
run: |
if (length(dir("man/figures", pattern = "\\.png$")) > 0)
cat("exists=true\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE)
- name: Minimize `man/figures` images
if: steps.man-figures.outputs.exists && inputs.minimize-man-figures
run: |
sudo apt-get install oxipng
oxipng -o 4 --strip safe man/figures/*.png
git add -A man/figures/*.png || echo 'No changes found in man/figures/*.png'
git commit -m "Shrink images in man/figures (Github Actions)" || echo "No changes in man/figures/*.png to commit"

- name: Find `README.Rmd`
id: readme
shell: Rscript {0}
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ There are three main reusable workflows to be used by packages in the shiny-vers
* Parameters:
* `extra-packages`, `cache-version`, `pandoc-version`: Same as in `website.yaml`
* `node-version`: Version of `node.js` to install
* `staticimports`: Determines if `staticimports` should display a warning message if the staticimports are out of date.
* `minimize-man-figures`: If any PNG images are found in `man/figures`, then the images are attempted to be minimized using `optipng`. This is useful for reducing the size of the package tarball without losing quality. Set to `false` to disable image minimization.
* `R-CMD-check.yaml`
* Performs `R CMD check .` on your package
* Parameters:
Expand All @@ -69,9 +71,8 @@ There are three main reusable workflows to be used by packages in the shiny-vers
* `macOS`: `macOS` runtime to use. Set to `false` to disable testing on macOS.
* `windows`: `windows` runtime to use. Set to `false` to disable testing on Windows.
* `ubuntu`: `ubuntu` runtime to use. To use more than one ubuntu value, send in a value separated by a space. For example, to test on ubuntu 18 and 20, use `"ubuntu-18.04 ubuntu20.04"`. The first `ubuntu` value will be tested using the `"devel"` R version. Set to `false` to disable testing on Ubuntu.
* staticimports: Determines if `staticimports` should display a warning message if the staticimports are out of date.
* minimum-r-version: If provided, only R versions >= to `minimum-r-version` will be created in the matrix. Great for dependencies that will not install on earlier R versions.
* rtools-35: If `false`, packages with a `src` folder will not test on Windows R 3.6 using `rtools35`.
* `minimum-r-version`: If provided, only R versions >= to `minimum-r-version` will be created in the matrix. Great for dependencies that will not install on earlier R versions.
* `rtools-35`: If `false`, packages with a `src` folder will not test on Windows R 3.6 using `rtools35`.

## Customization

Expand Down