-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (59 loc) · 1.72 KB
/
R-submit-on-CRAN.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: R submit on CRAN
on:
push:
pull_request:
schedule:
- cron: '0 2 * * SAT'
env:
PACKAGE_NAME: libkrigingtemplate
jobs:
release:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
rtools-version: '43'
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache: false
- name: setup for CRAN
shell: bash
run: |
Rscript --no-save ./tools/install_packages.R pkgbuild roxygen2
Rscript -e "remove.packages('roxygen2')"
- name: R CMD build
shell: bash
env:
OS: ${{ matrix.os }}
run: |
R CMD build .
mkdir CRAN-$OS
mv ${{ env.PACKAGE_NAME }}_*.* CRAN-$OS/.
- name: R CMD check
shell: bash
env:
OS: ${{ matrix.os }}
run: |
R CMD check --as-cran --no-manual CRAN-$OS/${{ env.PACKAGE_NAME }}* || (
test -f ${{ env.PACKAGE_NAME }}.Rcheck/00install.out && cat ${{ env.PACKAGE_NAME }}.Rcheck/00install.out | sed -e 's/^/00install.out| /' && echo "[The error may be shown before 00install.out| listing";
exit 1
)
- uses: actions/upload-artifact@v2
with:
path: ./CRAN-*
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./CRAN-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}