Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version python stufe 4 tc1196 vitalparameter koerpermasze #173

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/TC-version-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: TC version update

# Controls when the action will run.
on:
push:
branches:
- 'TC-*'
- 'TC_*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# setup python and run script
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v2 # checkout the repository content

- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10' # install the python version needed

- name: install python packages
run: |
python -m pip install --upgrade pip
pip install pyyaml

- name: execute py script # run main.py
run: python ./scripts/release_publish.py -b

- name: Add & Commit
uses: EndBug/add-and-commit@v9
with:
committer_name: GitHub Actions Bot
committer_email: [email protected]
message: auto-generated file update of TC version by GitHub Actions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Motivation und Hintergrund
Dieser Abschnitt des Implementierungsleitfadens beschreibt eine bidirektionale Überleitung zwischen Intensiv- und Normalversorgung auf der Ebene eines Workflows zur Datenkommunikation zwischen den betroffenen Systemen (PDMS und KIS)
Dieser Abschnitt des Implementierungsleitfadens beschreibt eine bidirektionale Überleitung zwischen Intensiv- und Normalversorgung auf der Ebene eines Workflows zur Datenkommunikation zwischen den betroffenen Systemen (PDMS und KIS).

### Stakeholder, User und weitere Systeme
Die Spezifikation richtet sich insbesondere an SW-Hersteller von KIS und PDMS.
Expand Down
9 changes: 9 additions & 0 deletions scripts/release_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ def get_new_release_version_from_branch_name() -> str:
return git_branch


def modify_TC_branch_name_to_version(git_branch):
if git_branch.startswith('TC-'):
version = git_branch.lstrip('TC-')
elif git_branch.startswith('TC_'):
version = git_branch.lstrip('TC_')
return version

def create_files_to_update_list(config):
files_to_update = []
for filename, replacements in config.items():
Expand Down Expand Up @@ -135,6 +142,8 @@ def main():
new_release_version = args.version
elif args.branch:
new_release_version = get_new_release_version_from_branch_name()
if new_release_version.startswith('TC'):
new_release_version = modify_TC_branch_name_to_version(new_release_version)
else:
parser.error('No new release version specified. Please use either -v or -b to specify the new release version.')

Expand Down