-
Notifications
You must be signed in to change notification settings - Fork 56
76 lines (65 loc) · 1.87 KB
/
branch.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: release-branch
on:
workflow_dispatch:
push:
tags:
- '*.*.*'
permissions:
contents: write
jobs:
branch-out:
name: Create a github branch
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get the branch version
id: get_branch
run: |
BRANCH=${GITHUB_REF/refs\/tags\//}
if ${{github.event_name == 'workflow_dispatch'}}; then
BRANCH=$(git describe --abbrev=0 --tags)
fi
echo "BRANCH=$(echo ${BRANCH} | cut -d '.' -f1-2 | tr -d 'v')" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
id: go
- name: Bump patch version
run: make patch
- name: Create new branch and commit changes to the minor branch
uses: EndBug/add-and-commit@v9
with:
default_author: user_info
message: 'Update patch version'
new_branch: ${{ steps.get_branch.outputs.BRANCH }}
author_name: elasticcloudclients
author_email: [email protected]
bump-minor-version:
name: Bump main version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
token: ${{ secrets.GH_TOKEN_EXTRA }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
id: go
- name: Bump main version
run: make minor; git diff
- name: Commit changes to main
uses: EndBug/add-and-commit@v9
with:
default_author: user_info
message: 'Update minor version'
branch: master
author_name: elasticcloudclients
author_email: [email protected]