-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (86 loc) · 2.94 KB
/
create_github_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
on:
push:
branches:
- devel
- RELEASE*
name: Create Github Release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
optimize_ci:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check_skip.outputs.skip }}
steps:
- name: Optimize CI
id: check_skip
uses: withgraphite/graphite-ci-action@main
with:
graphite_token: ${{secrets.GRAPHITE_TOKEN}}
create-release:
runs-on: ubuntu-latest
needs: [optimize_ci]
if: needs.optimize_ci.outputs.skip == 'false'
permissions:
contents: write
outputs:
tag_version: ${{ steps.create_release.outputs.tag_version }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Get most recent tag
id: get_tag
run: echo "TAG_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))" >> "$GITHUB_ENV"
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
echo "Creating release for tag $TAG_VERSION"
gh release create $TAG_VERSION --title "Release $TAG_VERSION" --notes "Release $TAG_VERSION" --target ${{ github.ref }}
echo "tag_version=$TAG_VERSION" >> "$GITHUB_OUTPUT"
create_release_artifacts:
needs: [create-release]
permissions:
contents: write
strategy:
fail-fast: false
matrix:
r_version: ['release', 'devel']
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Update system repositories
run: sudo apt-get update
- name: Install system dependencies
run: |
sudo apt-get install -y libxml2-dev \
libssl-dev libcurl4-openssl-dev \
libharfbuzz-dev libfribidi-dev \
pandoc
- name: Setup R
uses: r-lib/actions/setup-r@e6be4b3706e0f39bc7a4cf4496a5f2c4cb840040 # v2.10.1
with:
r-version: ${{ matrix.r_version }}
use-public-rspm: true
id: r
- name: Install dependencies
uses: r-lib/actions/setup-renv@e6be4b3706e0f39bc7a4cf4496a5f2c4cb840040 # v2.10.1
- name: Build Package
run: R CMD build .
- name: Rename Package
run: echo "NEWNAME=$(./utilities/rename-package.R *.tar.gz)" >> "$GITHUB_ENV"
- name: debug
run: |
echo "R version: ${{ steps.r.outputs.installed-r-version }}"
echo "Current Tag: ${{ needs.create-release.outputs.tag_version }}"
echo "Release File Name: ${{ env.NEWNAME }}"
- name: Upload Release Artifact
env:
RELEASE_TAG: ${{ needs.create-release.outputs.tag_version }}
GH_TOKEN: ${{ github.token }}
run: gh release upload ${{ env.RELEASE_TAG }} ${{ env.NEWNAME }}