2023-02-21 05:04:35 -08:00
|
|
|
name: 'Release: Create Pull Request'
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
base-branch:
|
2023-02-21 07:02:31 -08:00
|
|
|
description: 'The branch, tag, or commit to create this release PR from.'
|
2023-02-21 05:04:35 -08:00
|
|
|
required: true
|
|
|
|
default: 'master'
|
|
|
|
|
|
|
|
release-type:
|
|
|
|
description: 'A SemVer release type.'
|
|
|
|
required: true
|
|
|
|
type: choice
|
|
|
|
default: 'minor'
|
|
|
|
options:
|
|
|
|
- patch
|
|
|
|
- minor
|
2023-06-02 05:18:32 -07:00
|
|
|
- major
|
2023-02-21 05:04:35 -08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
create-release-pr:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
timeout-minutes: 5
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: actions/checkout@v4.1.1
|
2023-02-21 05:04:35 -08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
ref: ${{ github.event.inputs.base-branch }}
|
|
|
|
|
2024-02-02 03:58:26 -08:00
|
|
|
- run: corepack enable
|
2024-05-24 03:32:50 -07:00
|
|
|
- uses: actions/setup-node@v4.0.2
|
2023-02-21 05:04:35 -08:00
|
|
|
with:
|
2024-05-24 03:32:50 -07:00
|
|
|
node-version: 20.x
|
2023-06-27 07:15:29 -07:00
|
|
|
|
2023-02-21 05:04:35 -08:00
|
|
|
- run: npm install --prefix=.github/scripts --no-package-lock
|
|
|
|
|
|
|
|
- name: Bump package versions
|
|
|
|
run: |
|
|
|
|
echo "NEXT_RELEASE=$(node .github/scripts/bump-versions.mjs)" >> $GITHUB_ENV
|
|
|
|
env:
|
|
|
|
RELEASE_TYPE: ${{ github.event.inputs.release-type }}
|
|
|
|
|
2023-06-26 03:04:21 -07:00
|
|
|
- name: Update Changelog
|
|
|
|
run: node .github/scripts/update-changelog.mjs
|
2023-02-21 05:04:35 -08:00
|
|
|
|
2023-06-27 07:15:29 -07:00
|
|
|
- name: Push the base branch
|
|
|
|
run: |
|
|
|
|
git push -f origin refs/remotes/origin/${{ github.event.inputs.base-branch }}:refs/heads/release/${{ env.NEXT_RELEASE }}
|
|
|
|
|
2023-02-21 05:04:35 -08:00
|
|
|
- name: Push the release branch, and Create the PR
|
2023-06-27 07:15:29 -07:00
|
|
|
uses: peter-evans/create-pull-request@v5
|
2023-02-21 05:04:35 -08:00
|
|
|
with:
|
2023-06-27 07:15:29 -07:00
|
|
|
base: 'release/${{ env.NEXT_RELEASE }}'
|
|
|
|
branch: '${{ env.NEXT_RELEASE }}-pr'
|
2023-02-21 05:04:35 -08:00
|
|
|
commit-message: ':rocket: Release ${{ env.NEXT_RELEASE }}'
|
|
|
|
delete-branch: true
|
|
|
|
labels: 'release'
|
|
|
|
title: ':rocket: Release ${{ env.NEXT_RELEASE }}'
|
2023-06-27 07:15:29 -07:00
|
|
|
body-path: 'CHANGELOG-${{ env.NEXT_RELEASE }}.md'
|