-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (37 loc) · 1.15 KB
/
release.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
name: Build and Attach R Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
r-version: release
http-user-agent: release
use-public-rspm: true
- name: Build package
run: |
R CMD build .
FILENAME=$(ls dso_*.tar.gz)
echo "FILENAME=${FILENAME}" >> $GITHUB_ENV
- name: Check version
run: |
VERSION=$(echo $FILENAME | sed 's/.*_\(.*\).tar.gz/\1/')
if [ "v${VERSION}" != "${GITHUB_REF#refs/tags/}" ]; then
echo "Version mismatch. Tag version and package version should be the same."
exit 1
fi
- name: Attach tarball to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ env.FILENAME }}
asset_name: ${{ env.FILENAME }}
asset_content_type: application/gzip