Skip to content

Commit

Permalink
Set release workflow to re-use usmapdata release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
pdil committed Mar 31, 2024
1 parent 32571aa commit 26c93f9
Showing 1 changed file with 4 additions and 75 deletions.
79 changes: 4 additions & 75 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,78 +12,7 @@ on:

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check version number
env:
INPUT_VERSION: ${{ inputs.version }}
run: .github/workflow-resources/release-version-check.sh

- 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: "${{ github.event.repository.name }} ${{ inputs.version }}"
include: "NEWS.md"
regex: false

- name: Import GPG signing key
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.BOT_PAT }}
author: ${{ secrets.BOT_USER }}
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
draft: true
uses: pdil/usmapdata/.github/workflows/release.yaml
secrets: inherit
with:
version: ${{ inputs.version }}

0 comments on commit 26c93f9

Please sign in to comment.