Create Release PR #136
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: Create Release PR | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to bump to' | |
required: true | |
jobs: | |
bump_version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Bump version in pyproject.toml | |
run: | | |
poetry version $INPUT_VERSION | |
env: | |
INPUT_VERSION: ${{ github.event.inputs.version }} | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "basetenbot" | |
git add pyproject.toml | |
git commit -m "Bump version to $INPUT_VERSION" | |
env: | |
INPUT_VERSION: ${{ github.event.inputs.version }} | |
# TODO: Also push changes to main | |
- name: Push changes to new branch | |
run: | | |
git push origin HEAD:refs/heads/bump-version-${{ github.event.inputs.version }} | |
env: | |
GH_TOKEN: ${{ secrets.BASETENBOT_GITHUB_TOKEN }} | |
- name: Make PR | |
run: | | |
CURR_VERSION=$(curl https://pypi.org/pypi/truss/json | jq ".info.version") | |
PR_BODY="Updating Truss from [$CURR_VERSION](https://pypi.org/pypi/truss/json) to $INPUT_VERSION. **PLEASE ENSURE YOU MERGE, NOT SQUASH**" | |
PR_URL=$(gh pr create --base release --head refs/heads/bump-version-$INPUT_VERSION --title "Release $INPUT_VERSION" --body "$PR_BODY") | |
env: | |
INPUT_VERSION: ${{ github.event.inputs.version }} | |
GH_TOKEN: ${{ secrets.BASETENBOT_GITHUB_TOKEN }} |