Skip to content

Commit 6018a95

Browse files
committed
add check_version env
1 parent 459f543 commit 6018a95

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Diff for: .github/workflows/release.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ jobs:
2222
with:
2323
python-version: 3.11
2424

25-
- name: Install dependencies
26-
run: pip install -r requirements.txt
27-
2825
- name: Build and package
26+
env:
27+
CHECK_VERSION: "true"
2928
run: |
3029
pip install wheel
3130
python setup.py sdist bdist_wheel

Diff for: setup.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ def read_version():
99

1010

1111
def check_tag_version():
12-
tag = os.getenv("GITHUB_REF")
13-
expected_version = read_version()
14-
if tag != f"refs/tags/{expected_version}":
15-
raise Exception(
16-
f"Tag '{tag}' does not match the expected " f"version '{expected_version}'"
17-
)
12+
if os.getenv("CHECK_VERSION", "false").lower() == "true":
13+
tag = os.getenv("GITHUB_REF")
14+
expected_version = read_version()
15+
if tag != f"refs/tags/{expected_version}":
16+
raise Exception(
17+
f"Tag '{tag}' does not match the expected " f"version '{expected_version}'"
18+
)
1819

1920

2021
with open("README.md") as fh:

0 commit comments

Comments
 (0)