-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (61 loc) · 2.27 KB
/
python-post-release.yml
File metadata and controls
68 lines (61 loc) · 2.27 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
name: Python Post Release Workflow
on:
workflow_call:
inputs:
app-version:
description: Application version that was released
required: true
type: string
python-version:
description: The python version to use, default '3.12'
required: false
type: string
default: 3.12
main-branch:
description: Main branch name
required: false
type: string
default: main
pr-reviewers:
description: Users to be included on the post-release pull request
required: false
type: string
default: adesjardin, manikmagar, tannersherman
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
prepare-next-snapshot:
runs-on: ubuntu-latest
if: ${{ !contains(inputs.app-version, '.dev') && github.event_name != 'pull_request' && contains(github.ref, inputs.main-branch) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install build dependencies with UV
run: |
python -m pip install --upgrade pip
pip install uv
uv sync
- name: Increment Version
run: |
CURRENT=$(uv run toml get --toml-path=pyproject.toml project.version)
IFS='.' read -r major minor patch <<< "$CURRENT"
NEW_VERSION="$major.$minor.$((patch + 1)).dev1"
uv run toml set --toml-path=pyproject.toml project.version "$NEW_VERSION"
- name: Set New Version Variable
id: set-new-version
run: echo VERSION=$(uv run toml get --toml-path=pyproject.toml project.version) >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: "chore/v${{ steps.set-new-version.outputs.version }}"
commit-message: "chore: [create-pull-request] Auto increment to v${{ steps.set-new-version.outputs.version }}"
title: "chore: Auto increment to v${{ steps.set-new-version.outputs.version }}"
delete-branch: true
assignees: ${{ github.actor }}
reviewers: ${{ inputs.pr-reviewers }}