From 1244a47851179bfd3851825f23d8a4cdf25a80f3 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:16:39 +0000 Subject: [PATCH 1/8] 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 ebabf78..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 }} \ No newline at end of file From cfe94898329212365ad3ad9c24e4049f8029a7a6 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:17:47 +0000 Subject: [PATCH 2/8] 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..0df2a2e --- /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-acls + plugin_package_dir: netbox_acls + release_notes_from_pr_body: false + secrets: inherit From f1077bfbd9017f739b954a1bcab9fc8ec57eb677 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:18:05 +0000 Subject: [PATCH 3/8] 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..a0d2fc7 --- /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-acls + plugin_package_dir: netbox_acls + secrets: inherit From 5eced0df55884e3180dc8c81171dee90a4ee15dc Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:19:07 +0000 Subject: [PATCH 4/8] Update release-validation.yml --- .github/workflows/release-validation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-validation.yml b/.github/workflows/release-validation.yml index a0d2fc7..6b79c63 100644 --- a/.github/workflows/release-validation.yml +++ b/.github/workflows/release-validation.yml @@ -12,6 +12,6 @@ jobs: release: uses: netboxlabs/public-workflows/.github/workflows/reusable-plugin-release-validation.yml@develop with: - plugin_package_name: netbox-acls - plugin_package_dir: netbox_acls + plugin_package_name: netbox-qrcode + plugin_package_dir: netbox_qrcode secrets: inherit From 75c4888623a10989faa5194c7f63fad8685b3a52 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:19:20 +0000 Subject: [PATCH 5/8] Update release.yml --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0df2a2e..eafa7e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: release: uses: netboxlabs/public-workflows/.github/workflows/reusable-plugin-release.yml@develop with: - plugin_package_name: netbox-acls - plugin_package_dir: netbox_acls + plugin_package_name: netbox-qrcode + plugin_package_dir: netbox_qrcode release_notes_from_pr_body: false secrets: inherit From 2721fe5a147371f79e378fcfc4944eae6411872c Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:30:08 +0000 Subject: [PATCH 6/8] Update Makefile --- Makefile | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/Makefile b/Makefile index 414332d..4bc8c23 100644 --- a/Makefile +++ b/Makefile @@ -47,28 +47,6 @@ migrations: run netbox python manage.py makemigrations --name ${BUILD_NAME} docker-compose -f ${COMPOSE_FILE} -p ${BUILD_NAME} down - -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 - pbuild: python3 -m pip install --upgrade build python3 -m build - -pypipub: - python3 -m pip install --upgrade twine - python3 -m twine upload dist/* From 7486cfca6f33f4a1bd1048d404832a91d565b16c Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:30:39 +0000 Subject: [PATCH 7/8] Update version.py --- netbox_qrcode/version.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/netbox_qrcode/version.py b/netbox_qrcode/version.py index 4ae81f3..4ae7b54 100644 --- a/netbox_qrcode/version.py +++ b/netbox_qrcode/version.py @@ -1 +1,18 @@ -__version__ = "0.0.13" +#!/usr/bin/env python +"""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 c0da102f53fdf43f82f508f0cff6edf902be26b0 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:31:13 +0000 Subject: [PATCH 8/8] Update __init__.py --- netbox_qrcode/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_qrcode/__init__.py b/netbox_qrcode/__init__.py index 6d16a96..d50f023 100644 --- a/netbox_qrcode/__init__.py +++ b/netbox_qrcode/__init__.py @@ -1,12 +1,12 @@ from netbox.plugins import PluginConfig -from .version import __version__ +from .version import version_semver class QRCodeConfig(PluginConfig): name = 'netbox_qrcode' verbose_name = 'qrcode' description = 'Generate QR codes for the objects' - version = __version__ + version = version_semver() author = 'Nikolay Yuzefovich' author_email = 'mgk.kolek@gmail.com' required_settings = []