Skip to content
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
38 changes: 27 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,35 @@ jobs:
with:
python-version: 3.14.7

- name: Get latest release from pip
id: latestreleased
run: |
PREVIOUS_VERSION=$(python -m pip index versions biosimdb-interface | grep "biosimdb-interface" | cut -d "(" -f2 | cut -d ")" -f1)
echo "pip_tag=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT"
echo $PREVIOUS_VERSION
- name: Checkout repository (full history and tags)
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0

- name: version comparison
id: compare
- name: Ensure version is greater than latest git tag
run: |
pip3 install semver
output=$(pysemver compare ${{ steps.latestreleased.outputs.pip_tag }} ${{ github.event.inputs.version }})
if [ $output -ge 0 ]; then exit 1; fi
NEW_VERSION="${{ github.event.inputs.version }}"
git fetch --tags --force

LATEST_TAG=$(git tag --list | sed 's/^v//' | sort -V | tail -n 1)

if [ -z "$LATEST_TAG" ]; then
echo "No existing tags found; accepting version $NEW_VERSION"
exit 0
fi

if [ "$NEW_VERSION" = "$LATEST_TAG" ]; then
echo "Input version equals latest tag: $LATEST_TAG"
exit 1
fi

HIGHEST=$(printf '%s\n%s\n' "$LATEST_TAG" "$NEW_VERSION" | sort -V | tail -n 1)
if [ "$HIGHEST" != "$NEW_VERSION" ]; then
echo "Input version ($NEW_VERSION) must be greater than latest tag ($LATEST_TAG)"
exit 1
fi

echo "Version check passed: $LATEST_TAG -> $NEW_VERSION"

version:
name: prepare ${{ github.event.inputs.version }}
Expand Down
Loading