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

Feature/fix versioning #40

Merged
merged 2 commits into from
Jan 14, 2025
Merged
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
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
echo "pyproject_name=${pyproject_name}" >> $GITHUB_OUTPUT

current_version=$(poetry version -s)
base_version=${current_version%%-*}
echo "old_version=${current_version}" >> $GITHUB_ENV

# Version calculation based on branch
Expand All @@ -51,19 +52,19 @@ jobs:
elif [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
if [[ ${current_version} =~ -alpha ]]; then
alpha_num=$((${current_version##*alpha.} + 1))
new_version="${current_version%%-*}-alpha.${alpha_num}"
new_version="${base_version%%-*}-alpha.${alpha_num}"
else
new_version="${current_version}-alpha.1"
new_version="${base_version}-alpha.1"
fi
elif [[ "${{ github.ref }}" =~ ^refs/heads/release/ ]]; then
if [[ ${current_version} =~ -rc ]]; then
rc_num=$((${current_version##*rc.} + 1))
new_version="${current_version%%-*}-rc.${rc_num}"
new_version="${base_version%%-*}-rc.${rc_num}"
else
new_version="${current_version}-rc.1"
new_version="${base_version}-rc.1"
fi
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
new_version=${current_version%%-*}
new_version=${base_version%%-*}
fi

echo "new_version=${new_version}" >> $GITHUB_OUTPUT
Expand Down
Loading