-
Notifications
You must be signed in to change notification settings - Fork 11
73 lines (70 loc) · 2.4 KB
/
build-artifacts.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
73
name: build-artifacts
on: push
jobs:
build-artifacts:
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r-version: '3.6'}
- {os: windows-latest, r-version: '4.0'}
- {os: ubuntu-20.04, r-version: '4.0'}
runs-on: ${{ matrix.config.os }}
env:
INSEE_APP_KEY: ${{ secrets.INSEE_APP_KEY }}
INSEE_APP_SECRET: ${{ secrets.INSEE_APP_SECRET }}
CURLOPT_TIMEOUT: 0
steps:
- uses: actions/checkout@v2
- name: Set up R ${{ matrix.config.r-version }}
uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r-version }}
- name: Query dependencies
run: |
install.packages('remotes')
shell: Rscript {0}
- name: Install system dependencies - Linux
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install system dependencies - Windows
if: runner.os == 'Windows'
run: |
choco install pandoc
- name: Install R dependencies
run: |
install.packages(c("rcmdcheck", "httpuv", "devtools"))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Build source (Linux)
if: runner.os == 'Linux'
run: devtools::build(binary = FALSE, path = "dist")
shell: Rscript {0}
- name: Build windows binaries
if: runner.os == 'Windows'
run: devtools::build(binary = TRUE, path = "dist")
shell: Rscript {0}
- name: Get package version
if: runner.os == 'Linux'
run: |
Rscript -e 'devtools::install()'
PKGVERSION=$(Rscript -e 'as.character(packageVersion("doremifasol"))')
regex='\"(.*)\"'
[[ $PKGVERSION =~ $regex ]]
export PKGVERSION=${BASH_REMATCH[1]}
- name: Upload artifacts - Binaire Windows
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
with:
name: doremifasol_${PKGVERSION}_r${{ matrix.config.r-version }}.zip
path: dist/
- name: Upload artifacts - source
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: doremifasol_${PKGVERSION}_r${{ matrix.config.r-version }}.tar.gz
path: dist/