diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 241a0d0e..7e7b2d10 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -80,10 +80,14 @@ jobs: --set security.tls.autoGenerated=true - name: Check out code uses: actions/checkout@v3 + with: + fetch-depth: 0 + fetch-tags: true - name: Update version number - if: startsWith(github.ref, 'refs/tags/') run: | - sed -i -e "s/0.0.0/${GITHUB_REF##*/}/" pyproject.toml + # always replaces the version with the latest tag + # both for testing and version release + sed -i -e "s/0.0.0/$(git describe --tags --abbrev=0 | sed 's/^v//')/" pyproject.toml - name: Set up Python uses: actions/setup-python@v4 with: