Update Publications #68
This file contains hidden or 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: "Update Publications" | |
| on: | |
| schedule: | |
| - cron: "0 0 1 * *" | |
| workflow_dispatch: | |
| env: | |
| RETICULATE_AUTOCONFIGURE: 'FALSE' | |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| update-publications: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: '4.3.1' | |
| - name: Install system dependencies | |
| run: | | |
| export DEBIAN_FRONTEND=noninteractive | |
| sudo apt-get update && \ | |
| sudo apt-get -y install libpng-dev \ | |
| pandoc \ | |
| git-core \ | |
| libv8-dev \ | |
| libxml2-dev \ | |
| libcurl4-openssl-dev \ | |
| libssl-dev \ | |
| libssh2-1-dev \ | |
| zlib1g-dev \ | |
| libgit2-dev \ | |
| python3 \ | |
| python3-pip \ | |
| python3-dev \ | |
| python3-venv | |
| # pandoc-citeproc | |
| - name: Install dependencies | |
| run: | | |
| install.packages('remotes') | |
| remotes::install_cran('rentrez') | |
| remotes::install_cran('librarian') | |
| remotes::install_version('rjson', version='0.2.21') | |
| remotes::install_version('reticulate', version='1.28') | |
| reticulate::install_miniconda() | |
| reticulate::conda_remove("r-reticulate") | |
| # Create a new Conda environment with Python 3.10 | |
| reticulate::conda_create("r-reticulate", python_version = "3.10") | |
| # Must install a newer version of openssl or else this error occurs: | |
| # ImportError: /usr/lib/x86_64-linux-gnu/libcrypto.so.3: version OPENSSL_3.3.0' | |
| reticulate::conda_install("r-reticulate", packages = c("openssl=3.3.0"), channel = "conda-forge") | |
| # Force reticulate to use the new environment | |
| reticulate::use_condaenv("r-reticulate", required=TRUE) | |
| reticulate::py_config() | |
| remotes::install_cran("synapser", repos = c("http://ran.synapse.org", "https://cloud.r-project.org")) | |
| shell: Rscript {0} | |
| - name: Query PubMed and upload results | |
| run: | | |
| Rscript ./inst/scripts/query-pubmed-grants.R --grant_table syn51209786 --parent syn51317180 --pub_table syn51407023 --auth_token ${{ secrets.SYNAPSE_PAT }} |