From ee7faf769ac0565e667528652d966f46399ec64d Mon Sep 17 00:00:00 2001 From: Nico Felbinger <26925347+felbinger@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:23:05 +0200 Subject: [PATCH] adjusted pipeline to control version number for releases --- .github/workflows/ci.yaml | 13 +++++++++++++ setup.cfg | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 83d65f5..0d9e535 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,6 +43,19 @@ jobs: python -m pip install --upgrade pip pip install setuptools wheel + - name: "Find version" + if: startsWith(github.ref, 'refs/tags/') + id: meta + uses: docker/metadata-action@v5 + with: + images: image + tags: type=semver,pattern={{version}} + + - name: "Adjust version number in setup.cfg" + if: startsWith(github.ref, 'refs/tags/') + run: | + sed -i'' "s/0\\.0\\.0-git/${{ steps.meta.outputs.version }}/" setup.cfg + - name: Build Python package run: python setup.py sdist bdist_wheel diff --git a/setup.cfg b/setup.cfg index 486cb1d..1243065 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = django-wpm -version = 0.1 +version = 0.0.0-git description = A Django app to manage wireguard peers on wireguard capable routers. long_description = file: README.md url = https://github.com/secshellnet/wpm-django