-
-
Notifications
You must be signed in to change notification settings - Fork 94
56 lines (46 loc) · 1.79 KB
/
prepare-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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.