-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.5 KB
/
release-created.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
# As soon as a release branch is pushed, the minor version on develop is bumped automatically.
# This allows further development to continue on develop for ‘the next’ release.
name: Release Branch Created
# Run whenever a ref is created https://docs.github.com/en/actions/reference/events-that-trigger-workflows#create
on:
create
jobs:
# First job in the workflow builds and verifies the software artifacts
bump:
name: Bump minor version on develop
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Only run if ref created was a release branch
if:
${{ startsWith(github.ref, 'refs/heads/release/') }}
steps:
- name: Retrieve repository (on the develop branch)
uses: actions/checkout@v4
with:
ref: 'refs/heads/develop'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.3.2
- name: Bump minor version
run: |
poetry version ${GITHUB_REF#refs/heads/release/}
poetry version preminor
echo "software_version=$(poetry version | awk '{print $2}')" >> $GITHUB_ENV
- name: Commit Version Bump
run: |
git config --global user.name 'batchee bot'
git config --global user.email '[email protected]'
git commit -am "/version ${{ env.software_version }}"
git push