-
Notifications
You must be signed in to change notification settings - Fork 36
118 lines (98 loc) · 3.24 KB
/
release.yaml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
tags:
- "v**" # Push events to every tag including hierarchical tags like v1.0/beta
pull_request:
branches:
- main
paths:
- .github/actions/setup/action.yaml
- .github/workflows/release.yaml
- src/Makevars*
workflow_dispatch:
name: Release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
LIBR_POLARS_FEATURES: "full_features"
LIBR_POLARS_PROFILE: release-optimized
NOT_CRAN: "true"
permissions: read-all
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
permissions:
contents: write
strategy:
fail-fast: false
matrix:
config:
- { os: macos-12, r: "release" }
- { os: macos-14, r: "release" }
- { os: windows-latest, r: "release" }
- { os: ubuntu-latest, r: "release" }
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
rust-nightly: true
target: ''
token: "${{ secrets.GITHUB_TOKEN }}"
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true
Ncpus: 2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: dev
- name: Build lib
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
TARGET=x86_64-pc-windows-gnu
else
TARGET="$(rustc -vV | grep host | cut -d' ' -f2)"
fi
Rscript -e 'pkgbuild::compile_dll()'
echo "LIBR_POLARS_PATH=$(pwd)/src/rust/target/${TARGET}/${{ env.LIBR_POLARS_PROFILE }}/libr_polars.a" >>"$GITHUB_ENV"
- name: make binary R package + test on host arch
run: |
devtools::install(quick = TRUE)
devtools::test(stop_on_failure = TRUE)
fn = devtools::build(binary = TRUE, args = c('--preclean'))
if (R.version$os != "mingw32") {
newfn = paste0(substr(fn,1,regexpr("_",fn)),"_",R.version$platform,".",tools::file_ext(fn))
file.rename(fn,newfn)
} else {
file.rename(fn,"../polars.zip") #R expects specific windows binary filename
}
shell: Rscript {0}
- name: prep upload
run: |
mv ../polars* ./
- name: Upload produced R packages
uses: actions/upload-artifact@v4
with:
name: package-${{ matrix.config.os }}-${{ matrix.config.r }}
path: |
polars_*
polars.zip
- name: Upload produced R packages (source or binary) to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
with:
files: |
polars_*
polars.zip
- name: print files
run: print(list.files("..",recursive = TRUE,full.names=TRUE))
shell: Rscript {0}