Skip to content

Commit 1cc0168

Browse files
committed
Workflow name change, and check if version matches tag
1 parent 9638317 commit 1cc0168

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/ci-cd.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI_CD
1+
name: Python CI/CD
22

33
on: [push, pull_request]
44

@@ -74,6 +74,16 @@ jobs:
7474
uses: actions/setup-python@v4
7575
with:
7676
python-version: "3.10"
77+
- name: Check if properly tagged
78+
run: |
79+
PACKAGE_VERSION="$(python -c 'from tinify import __version__;print(__version__)')";
80+
CURRENT_TAG="${GITHUB_REF#refs/*/}";
81+
if [[ "${PACKAGE_VERSION}" != "${CURRENT_TAG}" ]]; then
82+
>&2 echo "Tag mismatch"
83+
>&2 echo "Version in tinify/version.py (${PACKAGE_VERSION}) does not match the current tag=${CURRENT_TAG}"
84+
>&2 echo "Skipping deploy"
85+
exit 1;
86+
fi
7787
- name: Install dependencies
7888
run: |
7989
pip install -r requirements.txt

0 commit comments

Comments
 (0)