From 5fbb7a1466258d235959816c9e16d4c0e0116fbb Mon Sep 17 00:00:00 2001 From: myifeng Date: Tue, 4 Jun 2024 10:49:04 +0800 Subject: [PATCH] Python versipn patch 1 (#66) * Update setup.py * Update python-ci.yml * Update python-publish.yml * Update python-ci.yml * Update python-publish.yml * Update setup.py * Update python-publish.yml * Update python-publish.yml --- .github/workflows/python-publish.yml | 15 +++++++++++++++ setup.py | 1 + 2 files changed, 16 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 567b4ba..848ce4f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -27,6 +27,21 @@ jobs: python -m pip install --upgrade pip pip install pytest setuptools wheel twine build if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Get release version + id: get_version + run: | + if [[ "$GITHUB_REF" == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/} + echo "Release version: $VERSION" + echo ::set-output name=VERSION::$VERSION + else + echo "Not a release tag. Exiting." + exit 1 + fi + - name: Update setup.py version + run: | + VERSION=${{ steps.get_version.outputs.VERSION }} + sed -i "s/version='0.0.0'/version='$VERSION'/" setup.py - name: Build and test run: | python -m build diff --git a/setup.py b/setup.py index 914791a..eea4432 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,7 @@ def read_file(filename): setup( name="article-parser", + version='0.0.0', author="myifeng", author_email="myifengs@gmail.com", maintainer="myifeng",