Skip to content

Commit

Permalink
Check tag
Browse files Browse the repository at this point in the history
  • Loading branch information
j-raghavan committed Jul 19, 2024
1 parent c68b180 commit e88ab56
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ jobs:
run: |
poetry config virtualenvs.create false
- name: Check for tag and create if not exists
id: check_tag
run: |
TAG_NAME=$(git describe --tags --abbrev=0 2>/dev/null)
if [ -z "$TAG_NAME" ]; then
NEW_TAG="v$(date +'%Y%m%d%H%M%S')"
git tag $NEW_TAG
git push origin $NEW_TAG
echo "::set-output name=tag::$NEW_TAG"
else
echo "Tag already exists: $TAG_NAME"
echo "::set-output name=tag::$TAG_NAME"
fi
- name: Semantic Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -52,4 +66,4 @@ jobs:
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_KEY }}
run: |
poetry publish
poetry publish

0 comments on commit e88ab56

Please sign in to comment.