Skip to content

Commit b78d2e9

Browse files
committed
Use 'shell : python' instead of script
1 parent e34653e commit b78d2e9

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

.github/workflows/publish-major-minor.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/publish-major-minor.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,24 @@ jobs:
1717
run: pip install -U packaging
1818
- name: Get versions
1919
id: get_versions
20-
run: python .github/workflows/publish-major-minor.py ${{ github.ref }}
20+
shell: python
21+
run: |
22+
import sys
23+
from packaging.version import parse
24+
print(sys.version_info)
25+
tag_ref = "${{ github.ref }}"
26+
tag_name = tag_ref.split("/")[-1]
27+
print(f"tag_name: {tag_name}")
28+
version = parse(tag_name)
29+
print(f"version: {version}")
30+
if not (version.is_prerelease):
31+
print("Creating new major and minor tags!")
32+
print(f"::set-output name=original_tag_name::{tag_name}")
33+
print(f"::set-output name=major_version::v{version.major}")
34+
print(f"::set-output name=minor_version::v{version.major}.{version.minor}")
35+
else:
36+
print("No tags created (dev or pre version)!")
37+
2138
- name: Push Tags Version
2239
if: steps.get_versions.outputs.original_tag_name != ''
2340
env:

0 commit comments

Comments
 (0)