-
-
Notifications
You must be signed in to change notification settings - Fork 16
80 lines (69 loc) · 2.17 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
name: release
on:
workflow_dispatch:
inputs:
version:
description: "Release version number (e.g. 1.0.2)"
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::devtools
any::rhub
github::r-lib/revdepcheck
- name: Run release checks
env:
EMAIL: ${{ secrets.RHUB_EMAIL }}
TOKEN: ${{ secrets.RHUB_TOKEN }}
VERSION: ${{ inputs.version }}
run: |
source(".github/workflow-resources/release-checklist.R")
release_checklist(
Sys.getenv("EMAIL"),
Sys.getenv("TOKEN"),
Sys.getenv("VERSION")
)
shell: Rscript {0}
- name: Update NEWS.md version
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "[unreleased]"
replace: "usmap ${{ inputs.version }}"
include: "NEWS.md"
regex: false
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Render PR body
id: pr-body
uses: chuhlomin/render-template@v1
with:
template: .github/workflow-resources/release-pr-body.md
vars: |
version: ${{ inputs.version }}
- name: Open pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT }}
committer: ${{ secrets.BOT_USER }}
commit-message: "[automated] Prepare for ${{ inputs.version }} release"
branch: release/${{ inputs.version }}
title: Release version ${{ inputs.version }}
body: ${{ steps.pr-body.outputs.result }}
reviewers: pdil
assignees: pdil
labels: release
delete-branch: true