packages #2266
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
name: packages | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '20 * * * *' | |
jobs: | |
packages: | |
runs-on: macOS-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_KEEP_PKG_SOURCE: yes | |
steps: | |
- name: Install R. | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install helper R package. | |
run: | | |
install.packages( | |
pkgs = "multiverse.internals", | |
repos = c("https://cloud.r-project.org", "https://community.r-multiverse.org"), | |
type = "binary" | |
) | |
shell: Rscript {0} | |
- name: Check out the universe. | |
uses: actions/checkout@v4 | |
- name: Check out contributions. | |
uses: actions/checkout@v4 | |
with: | |
repository: '${{ github.repository_owner }}/contributions' | |
path: 'contributions' | |
- name: Build packages.json. | |
run: | | |
multiverse.internals::aggregate_contributions( | |
input = file.path("contributions", "packages"), | |
output = "packages.json", | |
owner_exceptions = "https://github.com/cran" | |
) | |
shell: Rscript {0} | |
- name: Remove contributions local repo. | |
run: rm -rf contributions | |
- name: Commit and push changes. | |
run: | | |
if git diff --quiet && git diff --staged --quiet; then | |
echo "No changes to commit." | |
else | |
git config --global user.name github-actions | |
git config --global user.email [email protected] | |
git add packages.json | |
git commit -m "Update packages.json" | |
git push -u origin main | |
fi |