-
Notifications
You must be signed in to change notification settings - Fork 27
80 lines (63 loc) · 2.18 KB
/
binary-build.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
74
75
76
77
78
79
80
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
tags:
- '*.*.*.*'
workflow_dispatch:
name: binary-build
env:
release_name: ${{ vars.repo_name }}_${{ github.ref_name }}
jobs:
source_build:
runs-on: ubuntu-latest
name: Build source tarball
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
r-version: latest
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::pkgbuild
- name: Build source tarball
run: |
R CMD build --force --no-manual --resave-data --compact-vignettes=both --md5 .
mkdir -p ${{ github.workspace }}/artifacts
cp ${{ env.release_name }}.tar.gz ${{ github.workspace }}/artifacts
- uses: actions/upload-artifact@v4
with:
name: Source tarball
path: ${{ github.workspace }}/artifacts/${{ env.release_name }}.tar.gz
binary_build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release', ext: "tgz"}
- {os: windows-latest, r: 'release', ext: "zip"}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::pkgbuild
- name: Build binary
run: pkgbuild::build(binary=TRUE,manual=TRUE)
shell: Rscript {0}
- name: Copy tarball
run: |
mkdir -p ${{ github.workspace }}/artifacts
cp ../${{ env.release_name }}.${{ matrix.config.ext }} ${{ github.workspace }}/artifacts
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.os }}-${{ matrix.config.r }}
path: ${{ github.workspace }}/artifacts/${{ env.release_name }}.${{ matrix.config.ext }}