fix branch assertation

This commit is contained in:
Matthias Mair 2024-02-29 23:57:57 +01:00
parent 6db2e4a6ee
commit 277c2d5e97
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
2 changed files with 4 additions and 1 deletions

View File

@ -38,7 +38,7 @@ jobs:
-H "Authorization: ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/inventree/InvenTree/releases/generate-notes \
-d '{"tag_name":"${{ steps.version.outputs.tag }}","target_commitish":"${{ github.event.inputs.target }}","previous_tag_name":"${{ steps.version.outputs.old_version }}}","configuration_file_path":".github/release.yml"}')
-d '{"tag_name":"${{ steps.version.outputs.tag }}","target_commitish":"${{ steps.version.outputs.old_branch }}","previous_tag_name":"${{ steps.version.outputs.old_version }}}","configuration_file_path":".github/release.yml"}')
echo $auto_text
echo "auto_text=$auto_text" >> $GITHUB_OUTPUT
- name: "Dummy: Set version"

View File

@ -105,14 +105,17 @@ if __name__ == '__main__':
old_version = f'{highest_tupple[0]}.{highest_tupple[1]}.{highest_tupple[2]}'
if target == 'master':
tag = f'{highest_tupple[0]}.{highest_tupple[1] + 1}.0'
old_branch = 'master'
elif target == 'stable':
tag = f'{highest_tupple[0]}.{highest_tupple[1]}.{highest_tupple[2] + 1}'
old_branch = f'{highest_tupple[0]}.{highest_tupple[1]}.x'
else:
raise ValueError(f"Unknown target '{target}'")
new_tag = f'{tag} dev'
with open(os.getenv('GITHUB_OUTPUT'), 'a') as env_file:
env_file.write(f'old_version={old_version}\n')
env_file.write(f'old_branch={old_branch}\n')
env_file.write(f'tag={tag}\n')
env_file.write(f'new_tag={new_tag}\n')
exit(0)