diff --git a/.gitea/workflows/cicd.yml b/.gitea/workflows/cicd.yml index 42d8f65..979d6d0 100644 --- a/.gitea/workflows/cicd.yml +++ b/.gitea/workflows/cicd.yml @@ -62,6 +62,15 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} type=ref,event=tag + - name: Determine PEP 440 Version for Python Package + id: pkg_version + run: | + if [[ "${{ github.ref }}" == refs/tags/v* ]]; then + echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + else + echo "version=0.0.dev${{ github.run_number }}" >> $GITHUB_OUTPUT + fi + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 @@ -70,7 +79,7 @@ jobs: with: context: . push: true - build-args: VERSION=${{ steps.meta.outputs.version }} + build-args: VERSION=${{ steps.pkg_version.outputs.version }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache