From 952d3d0a8616b3be9527ef3f2e020b107589ec85 Mon Sep 17 00:00:00 2001 From: Farid Karimli Date: Thu, 29 Aug 2024 11:23:23 -0400 Subject: [PATCH] Tagging releases and push --- .github/workflows/publish.yml | 2 -- setup.py | 11 ++++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0d679e7..45fbb3a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,8 +2,6 @@ name: Publish to PyPI on: push: - branches: - - main tags: - "v*" diff --git a/setup.py b/setup.py index 8feaa85..19e8023 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ from setuptools import setup, find_packages +import os # Read the contents of requirements.txt with open("requirements.txt") as f: @@ -7,9 +8,17 @@ with open("README.md") as f: readme = f.read() +# Tag is in the format v0.1.0, so we need to remove the v +git_tag = os.environ.get("GITHUB_REF_NAME", "") + +if git_tag.startswith("v"): + version = git_tag[1:] +else: + version = git_tag + setup( name="edubotics-core", - version="0.1.0", + version=version, packages=find_packages(), package_dir={"edubotics-core": "edubotics_core"}, python_requires=">=3.7",