-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (83 loc) · 2.36 KB
/
release.yml
File metadata and controls
87 lines (83 loc) · 2.36 KB
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
name: R Package Release to GitHub
on:
push:
tags:
- 'v*.*-*'
jobs:
source_package:
runs-on: ubuntu-latest
container:
image: ghcr.io/gwmodel-lab/gwmodel3-test-debian-release:latest
outputs:
pkg_version: ${{ steps.read_version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Read Version
id: read_version
run: |
PKG_VERSION=`grep -Po "(?<=Version: )(\d+.\d+.\d+(.(alpha|beta)\d+)*)" DESCRIPTION`
echo "version=$PKG_VERSION" >> "$GITHUB_OUTPUT"
- name: Build R Package
run: R CMD build .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: GWmodel3_src
path: GWmodel3_*.tar.gz
win_prebuilt:
runs-on: windows-2022
needs: source_package
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
choco install pandoc
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
rtools-version: '42'
update-rtools: true
- name: Install R Dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, any::roxygen2
needs: check
- name: Install Package
run: |
mkdir tmp/Library
R.exe CMD INSTALL . --library=tmp/Library
- name: Create Prebuilt Package
run: |
R.exe -e 'zip(\"../../GWmodel3_${{ needs.source_package.outputs.pkg_version }}_win.zip\", \"GWmodel3\")'
working-directory: tmp/Library
shell: powershell
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: GWmodel3_win_prebuilt
path: GWmodel3_*.zip
release_github:
needs: win_prebuilt
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
path: artifact
pattern: GWmodel3*
merge-multiple: true
- name: List artifact
run: ls -alh artifact/*
- name: Release
uses: softprops/action-gh-release@v1
with:
files: artifact/*