Skip to content

Commit

Permalink
update ci.yml+v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LordLumineer committed Nov 12, 2023
1 parent f1f51a0 commit 9baaac9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ jobs:
- name: Uvicorn Run for Test
run: |
uvicorn ThroneAPI:app --host 0.0.0.0 --port 8000 --reload &
sleep 5 # Wait for FastAPI to start
- name: Get Current Version
id: get_current_version
run: echo "::set-output name=version::$(curl http://localhost:8000/version)"

- name: Get Previous Version
id: get_previous_version
run: echo "::set-output name=version::$(git show origin/main:FastAPI.py | grep -oP "API_VERSION = '\K[0-9.]+" )"
run: |
PREVIOUS_VERSION=$(git show origin/main:FastAPI.py | grep -oP "API_VERSION = '\K[0-9.]+" )
if [ -z "$PREVIOUS_VERSION" ]; then
echo "::set-output name=version::0.0.0" # Set a default version for the first commit
else
echo "::set-output name=version::$PREVIOUS_VERSION"
fi
- name: Compare Versions
id: compare_versions
Expand Down
2 changes: 1 addition & 1 deletion ThroneAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import requests

API_VERSION = "1.6.3"
API_VERSION = "0.1.0"

app = FastAPI(
title="ThroneAPI",
Expand Down

0 comments on commit 9baaac9

Please sign in to comment.