Skip to content

Commit 0d050c7

Browse files
committed
update workflows
1 parent 9eb5ca0 commit 0d050c7

File tree

4 files changed

+32
-47
lines changed

4 files changed

+32
-47
lines changed

.github/workflows/publish_pypi.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: Publish to PyPI via Trusted Publisher
22

33
on:
4-
workflow_run:
5-
workflows: ["Update Version"]
6-
types:
7-
- completed
4+
push:
5+
tags:
6+
- "*"
87

98
jobs:
109

@@ -21,6 +20,18 @@ jobs:
2120
with:
2221
fetch-depth: 0
2322

23+
- name: Check version
24+
run: |
25+
TAG_NAME=$(echo ${{ github.ref_name }})
26+
PYVERSION_FILE="pyfmm_gui/_version.py"
27+
PYTHON_VERSION=$(grep -oP '__version__ = "\K[0-9]+\.[0-9]+\.[0-9]+' ${PYVERSION_FILE})
28+
29+
if [ "$PYTHON_VERSION" != "${TAG_NAME:1}" ]; then
30+
echo "Version mismatch between tag and ${PYVERSION_FILE}"
31+
exit 1
32+
fi
33+
34+
2435
- name: Set up Python
2536
uses: actions/setup-python@v4
2637
with:

.github/workflows/publish_testpypi.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: Publish to TestPyPI
22

33
on:
4-
workflow_run:
5-
workflows: ["Update Version"]
6-
types:
7-
- completed
4+
push:
5+
tags:
6+
- "*"
87

98
jobs:
109
publish:
@@ -19,6 +18,18 @@ jobs:
1918
with:
2019
fetch-depth: 0
2120

21+
- name: Check version
22+
run: |
23+
TAG_NAME=$(echo ${{ github.ref_name }})
24+
PYVERSION_FILE="pyfmm_gui/_version.py"
25+
PYTHON_VERSION=$(grep -oP '__version__ = "\K[0-9]+\.[0-9]+\.[0-9]+' ${PYVERSION_FILE})
26+
27+
if [ "$PYTHON_VERSION" != "${TAG_NAME:1}" ]; then
28+
echo "Version mismatch between tag and ${PYVERSION_FILE}"
29+
exit 1
30+
fi
31+
32+
2233
- name: Set up Python
2334
uses: actions/setup-python@v4
2435
with:

.github/workflows/update_version.yml

-38
This file was deleted.

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
/build
33
/dist
44
/*.egg-info
5-
/pyfmm_gui/__pycache__
5+
/pyfmm_gui/__pycache__
6+
/.vscode

0 commit comments

Comments
 (0)