Skip to content

Commit

Permalink
ci: always set version
Browse files Browse the repository at this point in the history
Not only for releases.

Signed-off-by: Paul Spooren <[email protected]>
  • Loading branch information
aparcar committed Dec 10, 2024
1 parent 624c5a6 commit 0d5331f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand All @@ -24,11 +27,10 @@ jobs:
pip install poetry
- name: Set __version__ and poetry version
if: github.event_name == 'release'
run: |
TAG="$(git describe --tags --abbrev=0)"
echo "__version__ = \"${TAG##*v}\"" > asu/__init__.py
poetry version "${TAG##*v}"
TAG="$(git describe --tags | awk -F"-" '{if (NF>1) {print substr($1, 2)".post"$2} else {print substr($1, 2)}}')"
echo "__version__ = \"$TAG\"" > asu/__init__.py
poetry version "$TAG"
- name: Build and publish
if: github.event_name == 'release'
Expand Down

0 comments on commit 0d5331f

Please sign in to comment.