2020-12-16 18:50:02 +08:00
|
|
|
name: prepare release pr
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
branch:
|
|
|
|
description: 'Branch to base the release from'
|
|
|
|
required: true
|
|
|
|
default: ''
|
|
|
|
major:
|
|
|
|
description: 'Major release? (yes/no)'
|
|
|
|
required: true
|
|
|
|
default: 'no'
|
2021-06-25 02:05:56 +08:00
|
|
|
prerelease:
|
|
|
|
description: 'Prerelease (ex: rc1). Leave empty if not a pre-release.'
|
2021-08-28 01:26:30 +08:00
|
|
|
required: false
|
2021-06-25 02:05:56 +08:00
|
|
|
default: ''
|
2020-12-16 18:50:02 +08:00
|
|
|
|
2021-05-16 16:17:05 +08:00
|
|
|
# Set permissions at the job level.
|
|
|
|
permissions: {}
|
|
|
|
|
2020-12-16 18:50:02 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2021-05-16 16:17:05 +08:00
|
|
|
permissions:
|
2021-05-16 16:37:21 +08:00
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
2020-12-16 18:50:02 +08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Python
|
2020-12-19 02:44:20 +08:00
|
|
|
uses: actions/setup-python@v2
|
2020-12-16 18:50:02 +08:00
|
|
|
with:
|
|
|
|
python-version: "3.8"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install --upgrade setuptools tox
|
|
|
|
|
|
|
|
- name: Prepare release PR (minor/patch release)
|
2020-12-16 18:53:05 +08:00
|
|
|
if: github.event.inputs.major == 'no'
|
2020-12-16 18:50:02 +08:00
|
|
|
run: |
|
2021-08-28 01:46:28 +08:00
|
|
|
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --prerelease='${{ github.event.inputs.prerelease }}'
|
2020-12-16 18:50:02 +08:00
|
|
|
|
|
|
|
- name: Prepare release PR (major release)
|
2020-12-16 18:53:05 +08:00
|
|
|
if: github.event.inputs.major == 'yes'
|
2020-12-16 18:50:02 +08:00
|
|
|
run: |
|
2021-08-28 01:46:28 +08:00
|
|
|
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --major --prerelease='${{ github.event.inputs.prerelease }}'
|