@@ -17,38 +17,34 @@ jobs:
17
17
- name : Setup the Python Environment by installing Poetry
18
18
uses : ./.github/actions/setup-python-build-env
19
19
20
+ - name : Retrieve the project version
21
+ id : version
22
+ shell : bash
23
+ run : |
24
+ echo "proj_version=$(poetry version -s)" >> $GITHUB_OUTPUT
25
+
26
+ - name : Check if tag exists, only proceed if version has not been released
27
+ run : |
28
+ echo "Checking for tag: $PROJ_TAG"
29
+ if git rev-parse "refs/tags/$PROJ_TAG" >/dev/null 2>&1
30
+ echo "Version $PROJ_TAG already exists, version bump required to proceed."
31
+ exit 1
32
+ fi
33
+ env :
34
+ PROJ_TAG : v${{ steps.version.outputs.PROJ_VERSION }}
35
+
20
36
- name : Code Quality Check
21
37
shell : bash
22
38
run : make install && make tests
23
39
24
- - name : Poetry bump version, build and publish
25
- id : build
40
+ - name : Build library and publish to PyPi
26
41
shell : bash
27
42
run : |
28
- proj_version=$(poetry version -s)
29
- echo ::set-output name=PROJ_VERSION::$proj_version
30
43
poetry publish --build -u __token__ -p $PYPI_TOKEN
31
44
env :
32
45
PYPI_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
33
46
34
- - name : Check if Tag exists 🔍
35
- id : check_tag
36
- run : |
37
- echo "Checking for tag: $PROJ_TAG"
38
- if git rev-parse "refs/tags/$PROJ_TAG" >/dev/null 2>&1
39
- then
40
- echo "Tag $PROJ_TAG already exists."
41
- echo "tag_exists=true" >> $GITHUB_OUTPUT
42
- exit 0
43
- else
44
- echo "Tag $PROJ_TAG does not exist."
45
- echo "tag_exists=false" >> $GITHUB_OUTPUT
46
- fi
47
- env :
48
- PROJ_TAG : v${{ steps.build.outputs.PROJ_VERSION }}
49
-
50
47
- name : Create and Push Tag 🏷️
51
- if : steps.check_tag.outputs.tag_exists == 'false'
52
48
run : |
53
49
git tag $PROJ_TAG
54
50
git config user.name "GitHub Actions"
@@ -58,13 +54,13 @@ jobs:
58
54
echo "tag_created=true" >> $GITHUB_OUTPUT
59
55
env :
60
56
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61
- PROJ_TAG : v${{ steps.build .outputs.PROJ_VERSION }}
57
+ PROJ_TAG : v${{ steps.version .outputs.PROJ_VERSION }}
62
58
63
59
- name : Create a GitHub Release
64
- uses : softprops/action-gh-release@v1
60
+ uses : softprops/action-gh-release@v2
65
61
env :
66
62
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67
- PROJ_TAG : v${{ steps.build .outputs.PROJ_VERSION }}
63
+ PROJ_TAG : v${{ steps.version .outputs.PROJ_VERSION }}
68
64
with :
69
65
generate_release_notes : true
70
66
tag_name : $PROJ_TAG
0 commit comments