-
Notifications
You must be signed in to change notification settings - Fork 295
80 lines (71 loc) · 2.24 KB
/
bump-version-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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: bump-version-pr
on:
workflow_dispatch:
inputs:
version_part:
description: Which part of the version number to bump?
required: true
default: minor
type: choice
options:
- major
- minor
- patch
jobs:
bump-version-pr:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: humble
fetch-depth: 0
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Python 3.x
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: pip3 install -U catkin_tools
shell: bash
- name: Bump version from humble branch
id: bump-version-from-humble-branch
run: |
git checkout -b tmp/bot/bump_version_base
git fetch origin main
git merge origin/main
catkin_generate_changelog -y
git add *
git commit -m "update CHANGELOG.rst"
catkin_prepare_release -y --bump ${{ inputs.version_part }} --no-push
version=$(git describe --tags)
echo "version=${version}" >> $GITHUB_OUTPUT
shell: bash
- name: Create target branch
run: |
git checkout origin/main
git checkout -b chore/bot/bump_version
git merge tmp/bot/bump_version_base
git push origin chore/bot/bump_version --force
shell: bash
- name: Create PR
id: create-pr
run: >
gh
pr
create
--base=main
--body="Bump version to ${{ steps.bump-version-from-humble-branch.outputs.version }}"
--title="chore: bump version to ${{ steps.bump-version-from-humble-branch.outputs.version }}"
--head=chore/bot/bump_version
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}