Skip to content

Prepare Release

Prepare Release #32

name: Prepare Release
on:
workflow_dispatch:
inputs:
version:
description: 'The version to prepare the release for'
required: true
jobs:
prepare-release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Setup git config
run: |
git config --global user.name "hikari-bot"
git config --global user.email "90276125+hikari-bot[bot]@users.noreply.github.com"
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Run prepare script
env:
VERSION: ${{ inputs.version }}
run: bash scripts/ci/prepare-release.sh
- name: Create pull request
uses: repo-sync/pull-request@v2
with:
# We need to use a bot token to be able to trigger workflows that listen to pull_request calls
github_token: ${{ steps.generate_token.outputs.token }}
source_branch: task/prepare-release-${{ github.event.inputs.version }}
destination_branch: master
pr_assignee: ${{ github.event.sender.login }}
pr_title: Prepare for release of ${{ github.event.inputs.version }}
pr_body: |
Release preparation triggered by @${{ github.event.sender.login }}.
Once the pull request is merged, you can trigger a PyPI release by creating a GitHub release for \`${{ github.event.inputs.version }}\` in the repository.