Merge branch 'master' of github.com:ipeaGIT/r5r #12
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: Java R5RCore build | |
on: | |
push: | |
paths: | |
- java-r5rcore/** | |
- .github/workflows/java-r5rcore-build.yaml | |
jobs: | |
build: | |
env: | |
GH_TOKEN: ${{ github.token }} | |
runs-on: ubuntu-latest | |
# don't build on merges to master | |
if: ${{ !github.ref_protected }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install R packages | |
run: | | |
install.packages(c('devtools', 'remotes')) | |
remotes::install_deps(dependencies = TRUE) | |
shell: Rscript {0} | |
working-directory: r-package | |
- name: Install system dependencies | |
run: | | |
while read -r cmd | |
do | |
eval sudo $cmd | |
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') | |
working-directory: r-package | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 | |
with: | |
arguments: build | |
build-root-directory: java-r5rcore | |
- name: Create pull request | |
# https://github.com/actions/checkout/pull/1184 | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
mv java-r5rcore/build/libs/java-r5rcore-*.jar r-package/inst/jar/r5r.jar | |
git add r-package/inst/jar/r5r.jar | |
git commit -m "Rebuild JAR for commit ${GITHUB_SHA}" | |
git push |