-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
113 additions
and
40 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: "Release Prep" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "The version number for the next release." | ||
required: true | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- majorpoetr | ||
|
||
jobs: | ||
release_prep: | ||
name: "release prep" | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
|
||
- name: "checkout" | ||
uses: "actions/checkout@v3" | ||
with: | ||
clean: true | ||
fetch-depth: 0 | ||
|
||
- name: "set up python" | ||
uses: "actions/setup-python@v2" | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: "install poetry" | ||
uses: "snok/install-poetry@v1" | ||
with: | ||
virtualenvs-in-project: true | ||
|
||
- name: "install dependencies" | ||
run: | | ||
poetry install | ||
- name: "bump version" | ||
id: "bump_version" | ||
run: | | ||
next_version=$(poetry version ${{ github.event.inputs.version }} -s) | ||
echo "version=$next_version" >> $GITHUB_OUTPUT | ||
- name: "generate changelog" | ||
run: | | ||
$ENV:GH_HOST='github.com' | ||
gh extension install chelnak/gh-changelog | ||
gh changelog new --next-version ${{ steps.bump_version.version }} | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: "commit changes" | ||
run: | | ||
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com" | ||
git config --local user.name "GitHub Actions" | ||
git add . | ||
git commit -m "Release prep v${{ github.event.inputs.version }}" | ||
- name: "create pull request" | ||
uses: "peter-evans/create-pull-request@v4" | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "Release prep v${{ github.event.inputs.version }}" | ||
branch: "release-prep" | ||
delete-branch: true | ||
title: "Release prep v${{ github.event.inputs.version }}" | ||
base: "main" | ||
body: | | ||
Automated release-prep from commit ${{ github.sha }}. | ||
labels: "maintenance" |