From b78d2e95c3cdb379a38c56a15e05dea40f8f4027 Mon Sep 17 00:00:00 2001 From: s-weigand Date: Wed, 4 Nov 2020 00:23:22 +0100 Subject: [PATCH] Use 'shell : python' instead of script --- .github/workflows/publish-major-minor.py | 17 ----------------- .github/workflows/publish-major-minor.yml | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/publish-major-minor.py diff --git a/.github/workflows/publish-major-minor.py b/.github/workflows/publish-major-minor.py deleted file mode 100644 index b728046..0000000 --- a/.github/workflows/publish-major-minor.py +++ /dev/null @@ -1,17 +0,0 @@ -import sys - -from packaging.version import parse - -print(sys.version_info) -tag_ref = sys.argv[1] -tag_name = tag_ref.split("/")[-1] -print(f"tag_name: {tag_name}") -version = parse(tag_name) -print(f"version: {version}") -if not (version.is_prerelease): - print("Creating new major and minor tags!") - print(f"::set-output name=original_tag_name::{tag_name}") - print(f"::set-output name=major_version::v{version.major}") - print(f"::set-output name=minor_version::v{version.major}.{version.minor}") -else: - print("No tags created (dev or pre version)!") diff --git a/.github/workflows/publish-major-minor.yml b/.github/workflows/publish-major-minor.yml index d1a1778..6938514 100644 --- a/.github/workflows/publish-major-minor.yml +++ b/.github/workflows/publish-major-minor.yml @@ -17,7 +17,24 @@ jobs: run: pip install -U packaging - name: Get versions id: get_versions - run: python .github/workflows/publish-major-minor.py ${{ github.ref }} + shell: python + run: | + import sys + from packaging.version import parse + print(sys.version_info) + tag_ref = "${{ github.ref }}" + tag_name = tag_ref.split("/")[-1] + print(f"tag_name: {tag_name}") + version = parse(tag_name) + print(f"version: {version}") + if not (version.is_prerelease): + print("Creating new major and minor tags!") + print(f"::set-output name=original_tag_name::{tag_name}") + print(f"::set-output name=major_version::v{version.major}") + print(f"::set-output name=minor_version::v{version.major}.{version.minor}") + else: + print("No tags created (dev or pre version)!") + - name: Push Tags Version if: steps.get_versions.outputs.original_tag_name != '' env: