From 66f773882b83bdbd7856dcff67e94221e17762d1 Mon Sep 17 00:00:00 2001 From: Roman Dyakov Date: Sat, 3 Aug 2024 21:41:44 +0000 Subject: [PATCH] Auto change version --- .github/workflows/deploy_and_publish.yml | 7 +++++++ profcomff_definitions/__init__.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_and_publish.yml b/.github/workflows/deploy_and_publish.yml index d00f63e2..bebc3d80 100644 --- a/.github/workflows/deploy_and_publish.yml +++ b/.github/workflows/deploy_and_publish.yml @@ -82,6 +82,12 @@ jobs: with: python-version: "3.11" + - name: Change version + run: | + VERSION=${{ github.ref_name }} + sed -i -e "s/__version__ = 'latest'/__version__ = '${VERSION:1}'/g" ${{ github.workspace }}/profcomff_definitions/__init__.py + + - name: Install dependencies run: | python -m ensurepip @@ -92,3 +98,4 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} + skip-existing: true diff --git a/profcomff_definitions/__init__.py b/profcomff_definitions/__init__.py index 262d0562..0e97869c 100644 --- a/profcomff_definitions/__init__.py +++ b/profcomff_definitions/__init__.py @@ -2,7 +2,7 @@ import sys -__version__ = '2024.05.10' +__version__ = 'latest' # Не менять, работает автоматика dir_path = os.path.dirname(os.path.abspath(__file__))