From a9eee2d63e78d916ee373a5a2443034e7829b7e1 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:22:48 +0000 Subject: [PATCH 1/6] Delete .github/workflows/pub-pypi.yml --- .github/workflows/pub-pypi.yml | 35 ---------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 .github/workflows/pub-pypi.yml diff --git a/.github/workflows/pub-pypi.yml b/.github/workflows/pub-pypi.yml deleted file mode 100644 index 2b57e7c..0000000 --- a/.github/workflows/pub-pypi.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI - -on: - release: - types: [published] - -jobs: - build-n-publish: - name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: Install pypa/build - run: >- - python -m - pip install - build - --user - - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} From 390527e1f10e02f8ece062e60113578f19fd9240 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:23:34 +0000 Subject: [PATCH 2/6] Create release.yml --- .github/workflows/release.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fedaf0e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,17 @@ +name: Release +on: + push: + branches: [ release ] + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +jobs: + release: + uses: netboxlabs/public-workflows/.github/workflows/reusable-plugin-release.yml@develop + with: + plugin_package_name: netbox-bgp + plugin_package_dir: netbox_bgp + release_notes_from_pr_body: false + secrets: inherit From 543d77bb9915df3d86cfa9a0cb363ad4c56af856 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:23:59 +0000 Subject: [PATCH 3/6] Create release-validation.yml --- .github/workflows/release-validation.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/release-validation.yml diff --git a/.github/workflows/release-validation.yml b/.github/workflows/release-validation.yml new file mode 100644 index 0000000..9c243b5 --- /dev/null +++ b/.github/workflows/release-validation.yml @@ -0,0 +1,17 @@ +name: Release validation +on: + pull_request: + branches: release + types: [ opened, edited ] + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +jobs: + release: + uses: netboxlabs/public-workflows/.github/workflows/reusable-plugin-release-validation.yml@develop + with: + plugin_package_name: netbox-bgp + plugin_package_dir: netbox_bgp + secrets: inherit From 19603e856f2c3f3dc7107f3fb8eef4b9cfd6e599 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:27:17 +0000 Subject: [PATCH 4/6] Update version.py --- netbox_bgp/version.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/netbox_bgp/version.py b/netbox_bgp/version.py index 9e78220..2de2087 100644 --- a/netbox_bgp/version.py +++ b/netbox_bgp/version.py @@ -1 +1,19 @@ -__version__ = "0.14.0" +#!/usr/bin/env python +# Copyright 2024 NetBox Labs Inc +"""Version stamp.""" + +# These properties are injected at build time by the build process. + +__commit_hash__ = "unknown" +__track__ = "dev" +__version__ = "0.0.0" + + +def version_display(): + """Display the version, track and hash together.""" + return f"v{__version__}-{__track__}-{__commit_hash__}" + + +def version_semver(): + """Semantic version.""" + return __version__ From d86ef72e3a615bd52da3dbbe8bff82861a37dbde Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:27:46 +0000 Subject: [PATCH 5/6] Update __init__.py --- netbox_bgp/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_bgp/__init__.py b/netbox_bgp/__init__.py index 6e4280f..e4e3dab 100644 --- a/netbox_bgp/__init__.py +++ b/netbox_bgp/__init__.py @@ -1,12 +1,12 @@ from netbox.plugins import PluginConfig -from .version import __version__ +from .version import version_semver class BGPConfig(PluginConfig): name = 'netbox_bgp' verbose_name = 'BGP' description = 'Subsystem for tracking bgp related objects' - version = __version__ + version = version_semver() author = 'Nikolay Yuzefovich' author_email = 'mgk.kolek@gmail.com' base_url = 'bgp' From 871b803a9004d6604f2dc8e1d1dbe24d8bad47a8 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:28:54 +0000 Subject: [PATCH 6/6] Update Makefile --- Makefile | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/Makefile b/Makefile index 48aecd9..7642880 100644 --- a/Makefile +++ b/Makefile @@ -51,27 +51,6 @@ pbuild: python3 -m pip install --upgrade build python3 -m build -pypipub: - python3 -m pip install --upgrade twine - python3 -m twine upload dist/* - -relpatch: - $(eval GSTATUS := $(shell git status --porcelain)) -ifneq ($(GSTATUS),) - $(error Git status is not clean. $(GSTATUS)) -endif - git checkout develop - git remote update - git pull origin develop - $(eval CURVER := $(shell cat $(VERFILE) | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')) - $(eval NEWVER := $(shell pysemver bump patch $(CURVER))) - $(eval RDATE := $(shell date '+%Y-%m-%d')) - git checkout -b release-$(NEWVER) origin/develop - echo '__version__ = "$(NEWVER)"' > $(VERFILE) - git commit -am 'bump ver' - git push origin release-$(NEWVER) - git checkout develop - test: docker-compose -f ${COMPOSE_FILE} -p ${BUILD_NAME} run netbox python manage.py test ${BUILD_NAME}