Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENG-3809 Common release process #223

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .github/workflows/pub-pypi.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/release-validation.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 0 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
4 changes: 2 additions & 2 deletions netbox_bgp/__init__.py
Original file line number Diff line number Diff line change
@@ -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 = '[email protected]'
base_url = 'bgp'
Expand Down
20 changes: 19 additions & 1 deletion netbox_bgp/version.py
Original file line number Diff line number Diff line change
@@ -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__