From 09b314984583ffe0c2183ddc1046d6bbfbb91263 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 19:51:14 +0000 Subject: [PATCH 1/6] feat: ENG-3807 Release workflow calling public-workflows --- .github/workflows/release.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..6cb1936 --- /dev/null +++ b/.github/workflows/release.yaml @@ -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-floorplan-plugin + plugin_package_dir: netbox_floorplan + release_notes_from_pr_body: false + secrets: inherit From 9e53030bd9e5c3ed517a7c0711d1b771ff74369b Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 19:51:42 +0000 Subject: [PATCH 2/6] chore: Delete .github/workflows/pub-pypi.yml --- .github/workflows/pub-pypi.yml | 36 ---------------------------------- 1 file changed, 36 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 c016a37..0000000 --- a/.github/workflows/pub-pypi.yml +++ /dev/null @@ -1,36 +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 - environment: release - permissions: - id-token: write - contents: read - 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 From 2df8a477fe888962fa4d07257eb1e21c36227b0a Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 19:58:04 +0000 Subject: [PATCH 3/6] chore: Create release-validation.yaml --- .github/workflows/release-validation.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/release-validation.yaml diff --git a/.github/workflows/release-validation.yaml b/.github/workflows/release-validation.yaml new file mode 100644 index 0000000..8309a2b --- /dev/null +++ b/.github/workflows/release-validation.yaml @@ -0,0 +1,17 @@ +name: Release +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-floorplan-plugin + plugin_package_dir: netbox_floorplan + secrets: inherit From 7b85818f4f8a11f41b5c00a727eb54186c43c7bf Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:08:00 +0000 Subject: [PATCH 4/6] Update release-validation.yaml --- .github/workflows/release-validation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-validation.yaml b/.github/workflows/release-validation.yaml index 8309a2b..973e783 100644 --- a/.github/workflows/release-validation.yaml +++ b/.github/workflows/release-validation.yaml @@ -1,4 +1,4 @@ -name: Release +name: Release validation on: pull_request: branches: release From 8532e14586d0725dcabe898c675901700208b0cb Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:32:44 +0000 Subject: [PATCH 5/6] Update version.py --- netbox_floorplan/version.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/netbox_floorplan/version.py b/netbox_floorplan/version.py index 3d26edf..4ae7b54 100644 --- a/netbox_floorplan/version.py +++ b/netbox_floorplan/version.py @@ -1 +1,18 @@ -__version__ = "0.4.1" +#!/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 f00c111837d84f9b34dca6b043cf2388fe5e4d7c Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Mon, 4 Nov 2024 20:33:55 +0000 Subject: [PATCH 6/6] Update __init__.py --- netbox_floorplan/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox_floorplan/__init__.py b/netbox_floorplan/__init__.py index 9ae55ab..ff0e0d5 100644 --- a/netbox_floorplan/__init__.py +++ b/netbox_floorplan/__init__.py @@ -1,4 +1,5 @@ from netbox.plugins import PluginConfig +from .version import version_semver class FloorplanConfig(PluginConfig): @@ -6,7 +7,7 @@ class FloorplanConfig(PluginConfig): name = "netbox_floorplan" verbose_name = "Netbox Floorplan" description = "" - version = "0.4.1" + version = version_semver() base_url = "floorplan" min_version = "4.0.2" max_version = "4.0.11"