Skip to content

Commit d1b053e

Browse files
committed
use python to validate version
1 parent e96ba06 commit d1b053e

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

.github/workflows/run-build.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
name: Run Build
44
on:
55
push:
6+
tags:
7+
- v*.*.*
68

79
defaults:
810
run:
@@ -39,6 +41,26 @@ jobs:
3941
run: |
4042
poetry config virtualenvs.in-project true
4143
44+
- name: Get tag POETRY tag
45+
id: poetry-tag
46+
run: echo ::set-output name=TAG::v$(poetry version -s)
47+
48+
- name: Get GITHUB tag
49+
id: git-tag
50+
run: echo ::set-output name=TAG::${GITHUB_REF#refs/*/}
51+
52+
- name: Print tags
53+
run: |
54+
echo POETRY ${{ steps.poetry-tag.outputs.TAG }}
55+
echo GIT ${{ steps.git-tag.outputs.TAG }}
56+
57+
- name: Validate tag
58+
run: |
59+
poetryTag="${{ steps.poetry-tag.outputs.TAG }}"
60+
gitTag="${{ steps.git-tag.outputs.TAG }}"
61+
python -c "import sys; eq='$poetryTag'!='$gitTag'; sys.exit(int(eq))"
62+
exit $?
63+
4264
- name: Set up cache
4365
uses: actions/cache@v2
4466
with:
@@ -58,13 +80,6 @@ jobs:
5880
id: exe-name
5981
run: echo ::set-output name=NAME::$(poetry version) - ${{ format(matrix.os) }}
6082

61-
- name: Get tag
62-
id: my-tag
63-
run: echo ::set-output name=TAG::v$(poetry version -s)
64-
65-
- name: Validate tag
66-
run: exit 1
67-
6883
- name: Add pyinstaller to path (Windows)
6984
if: ${{ matrix.os == 'windows-latest' }}
7085
run: echo ".venv/scripts" >> $GITHUB_PATH
@@ -90,7 +105,7 @@ jobs:
90105
removeArtifacts: false
91106
replaceArtifacts: true
92107
body: "Automatically generated release."
93-
tag: ${{ steps.my-tag.outputs.TAG }}
108+
tag: ${{ steps.poetry-tag.outputs.TAG }}
94109

95110

96111

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "db-temperature-distribution"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = ""
55
authors = ["Vojtech Panek <vojtech.panek@designbuilder.co.uk>"]
66

0 commit comments

Comments
 (0)