Skip to content

Commit

Permalink
👷 Update Docker build action
Browse files Browse the repository at this point in the history
  • Loading branch information
summerkirakira committed May 23, 2024
1 parent a584ca0 commit 7a8faa2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- name: Get version from pyproject.toml
id: get_version
run: echo "VERSION=$(toml get backend/pyproject.toml tool.poetry.version)" >> $GITHUB_ENV
run: echo "VERSION=$(python backend/read_version.py)" >> $GITHUB_ENV

- name: Docker Login
uses: docker/[email protected]
Expand Down
15 changes: 15 additions & 0 deletions backend/read_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import toml
from pathlib import Path

file_path = Path(__file__).parent / 'pyproject.toml'


def get_version():
with open(file_path, 'r') as f:
data = toml.load(f)
return data['tool']['poetry']['version']


if __name__ == "__main__":
version = get_version()
print(version)

0 comments on commit 7a8faa2

Please sign in to comment.