add release workflow

This commit is contained in:
Maxwell G 2023-08-13 18:00:23 +00:00
commit 360c5bb96f
Signed by: gotmax23
GPG key ID: F79E4E25E8C661F8
4 changed files with 26 additions and 5 deletions

2
.gitignore vendored
View file

@ -5,3 +5,5 @@
__pycache__/
*.src.rpm
*.tar.gz
/FRAG.md
/GIT_MSG

2
NEWS.md Normal file
View file

@ -0,0 +1,2 @@
NEWS
========

View file

@ -4,8 +4,8 @@
%bcond tests 1
Name: forge-srpm-macros
Version: 0.1.0
Release: 1%{?dist}
Version: 0.0.1
Release: 0%{?dist}
Summary: Macros to simplify packaging of forge-hosted projects
License: GPL-1.0-or-later
@ -54,7 +54,4 @@ export MACRO_LUA_DIR="%{buildroot}/usr/lib/rpm/lua"
%{_rpmluadir}/fedora/srpm/forge.lua
%changelog
* Fri Aug 11 2023 Maxwell G <maxwell@gtmx.me> - 0.1.0-1
- Initial package.

View file

@ -8,12 +8,20 @@ from pathlib import Path
import nox
RELEASERR = "releaserr @ git+https://git.sr.ht/~gotmax23/releaserr"
LINT_SESSIONS = ("static", "formatters", "typing")
PY_FILES = ("tests", "noxfile.py")
YAML_FILES = (".builds", "tests/vectors.yaml")
nox.options.sessions = (*LINT_SESSIONS, "test")
# Helpers
def git(session: nox.Session, *args, **kwargs):
return session.run("git", *args, **kwargs, external=True)
# General
@nox.session(venv_backend="none")
def lint(session: nox.Session):
@ -81,3 +89,15 @@ def mockbuild(session: nox.Session):
if not session.interactive:
margs.append("--verbose")
session.run(*margs, external=True)
@nox.session
def bump(session: nox.Session):
version = session.posargs[0]
session.install(RELEASERR, "fclogr")
session.run("releaserr", "check-tag", version)
session.run(
"fclogr", "bump", "--new", version, "--comment", f"Update to {version}."
)
git(session, "add", "forge-srpm-macros.spec")
session.run("releaserr", "clog", version, "--tag")