-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (54 loc) · 1.64 KB
/
create_publish_pr.yaml
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
# takes the most recent commit on main, bumps version based on
# semver_component input, and PRs change back to main
name: Bump version and PR
on:
workflow_dispatch:
inputs:
semver_component:
description: "Semantic versioning component to bump"
required: true
type: choice
default: "patch"
options:
- major
- minor
- patch
- dev
jobs:
publish:
name: Bump and PR
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bumpver
- name: Bump version
run: |
git config --global user.name 'aicsgithub'
git config --global user.email '[email protected]'
python scripts/publish_bumpver_handler.py ${{ inputs.semver_component }}
# takes the commit from the last step, pushes to new branch, release, and creates PR
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
branch: workflow-release
base: main
title: Bump version and publish
body: See commit message or diff for new version number
- name: Tag version
run: |
git checkout workflow-release
python scripts/tag_with_current_version.py
git push origin --tags