forked from SAP-archive/fedem-solvers
-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (35 loc) · 1.18 KB
/
versioning.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
# SPDX-FileCopyrightText: 2023 SAP SE
#
# SPDX-License-Identifier: Apache-2.0
#
# This file is part of FEDEM - https://openfedem.org
name: Bump build number
on:
push:
branches:
- main
jobs:
bump-build-no:
if: github.event.commits[0].author.name != 'github-actions'
runs-on: ubuntu-latest
steps:
- name: Check out source code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.ACCESS_PAT }}
- name: Bump build number
run: echo "VERSION=$(awk -F. '{$NF++;print}' OFS=. < cfg/VERSION)" >> $GITHUB_ENV
- name: Update VERSION file
run: |
echo $VERSION > cfg/VERSION
echo $VERSION > PythonAPI/version.txt
sed -i "/^release =/s/[0-9][0-9\.]*/$VERSION/" PythonAPI/doc/source/conf.py
sed "s/\"//g" fedem-foundation/src/Admin/version.h > cfg/RELEASE
- name: Push updated VERSION file
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git commit -m"chore(version): build number $VERSION" cfg PythonAPI
git push origin HEAD