| 1 |
name: prepare release pr |
| 2 |
|
| 3 |
on: |
| 4 |
workflow_dispatch: |
| 5 |
inputs: |
| 6 |
branch: |
| 7 |
description: 'Branch to base the release from' |
| 8 |
required: true |
| 9 |
default: '' |
| 10 |
major: |
| 11 |
description: 'Major release? (yes/no)' |
| 12 |
required: true |
| 13 |
default: 'no' |
| 14 |
prerelease: |
| 15 |
description: 'Prerelease (ex: rc1). Leave empty if not a pre-release.' |
| 16 |
required: false |
| 17 |
default: '' |
| 18 |
|
| 19 |
# Set permissions at the job level. |
| 20 |
permissions: {} |
| 21 |
|
| 22 |
jobs: |
| 23 |
build: |
| 24 |
runs-on: ubuntu-latest |
| 25 |
permissions: |
| 26 |
contents: write |
| 27 |
pull-requests: write |
| 28 |
|
| 29 |
steps: |
| 30 |
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 31 |
with: |
| 32 |
fetch-depth: 0 |
| 33 |
# persist-credentials is needed in order for us to push the release branch. |
| 34 |
persist-credentials: true |
| 35 |
|
| 36 |
- name: Set up Python |
| 37 |
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 38 |
with: |
| 39 |
python-version: "3.13" |
| 40 |
|
| 41 |
- name: Install tox |
| 42 |
run: | |
| 43 |
python -m pip install --upgrade pip |
| 44 |
pip install tox |
| 45 |
|
| 46 |
- name: Prepare release PR (minor/patch release) |
| 47 |
if: github.event.inputs.major == 'no' |
| 48 |
env: |
| 49 |
BRANCH: ${{ github.event.inputs.branch }} |
| 50 |
PRERELEASE: ${{ github.event.inputs.prerelease }} |
| 51 |
GH_TOKEN: ${{ github.token }} |
| 52 |
run: | |
| 53 |
tox -e prepare-release-pr -- "$BRANCH" --prerelease="$PRERELEASE" |
| 54 |
|
| 55 |
- name: Prepare release PR (major release) |
| 56 |
if: github.event.inputs.major == 'yes' |
| 57 |
env: |
| 58 |
BRANCH: ${{ github.event.inputs.branch }} |
| 59 |
PRERELEASE: ${{ github.event.inputs.prerelease }} |
| 60 |
GH_TOKEN: ${{ github.token }} |
| 61 |
run: | |
| 62 |
tox -e prepare-release-pr -- "$BRANCH" --major --prerelease="$PRERELEASE" |