release #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "The version number for new release, 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/workflows/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 | |
- name: Render PR body | |
id: pr-body | |
uses: chuhlomin/render-template@v1 | |
with: | |
template: .github/workflows/release-pr-body.md | |
vars: | | |
version: ${{ inputs.version }} | |
- name: Open pull request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
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 |