Skip to content

Commit 78f33ff

Browse files
committed
minor changes to nox tag process
1 parent 856487c commit 78f33ff

File tree

2 files changed

+44
-64
lines changed

2 files changed

+44
-64
lines changed

docs/source/about/contributor-guide.rst

+20-48
Original file line numberDiff line numberDiff line change
@@ -268,61 +268,33 @@ Where you can then navigate to http://localhost:5000..
268268
Release Process
269269
---------------
270270

271-
1. :ref:`Update version <Update Release Version>`
272-
2. Create a release tag
273-
3. Manually author a release in GitHub
271+
Creating a release for IDOM involves two steps:
274272

273+
1. Tagging a version
274+
2. Publishing a release
275275

276-
Update Release Version
277-
......................
278-
279-
To simultaneously update the version for:
280-
281-
- Python packages
282-
- Javascript packages
283-
- The :ref:`changelog`
284-
285-
Run the following command:
286-
287-
.. code-block:: bash
288-
289-
nox -s update_version -- <new-version>
290-
291-
.. note::
292-
293-
The ``<new-version>`` must adhere to `SemVer <https://semver.org/>`__.
294-
295-
Then commit those changes:
276+
To **tag a version** you'll run the following command:
296277

297278
.. code-block:: bash
298279
299-
git commit -m 'update version to <new-version>'
280+
nox -s tag -- <the-new-version>
300281
282+
Which will update the version for:
301283

302-
Creating The Release
303-
....................
304-
305-
The final release process involves two steps:
306-
307-
1. Creating a tag for the release
308-
2. Authoring a release in GitHub
309-
310-
To create the release tag you can run the following command:
311-
312-
.. note::
313-
314-
To just create the tag without pushing, omit the trailing ``push`` argument
315-
316-
.. code-block:: bash
317-
318-
nox -s tag -- push
319-
320-
Last, you must create a `"Release"
321-
<https://docs.github.com/en/github/administering-a-repository/releasing-projects-on-github/managing-releases-in-a-repository>`__
322-
in GitHub. Because we pushed a tag using the command above, there should already be a
323-
saved draft which needs a title and description. The title should simply be the version
324-
(same as the tag), and the description should simply use GitHub's "Auto-generated
325-
release notes".
284+
- Python packages
285+
- Javascript packages
286+
- The changelog
287+
288+
You'll be then prompted to confirm the auto-generated updates before those changes will
289+
be staged, committed, and pushed along with a new tag matching ``<the-new-version>``
290+
which was specified earlier.
291+
292+
Lastly, to **publish a release** `create one in GitHub
293+
<https://docs.github.com/en/github/administering-a-repository/releasing-projects-on-github/managing-releases-in-a-repository>`__.
294+
Because we pushed a tag using the command above, there should already be a saved tag you
295+
can target when authoring the release. The release needs a title and description. The
296+
title should simply be the version (same as the tag), and the description should simply
297+
use GitHub's "Auto-generated release notes".
326298

327299

328300
Other Core Repositories

noxfile.py

+24-16
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,25 @@ def build_js(session: Session) -> None:
289289
@nox.session
290290
def tag(session: Session) -> None:
291291
"""Create a new git tag"""
292+
try:
293+
session.run(
294+
"git",
295+
"diff",
296+
"--cached",
297+
"--exit-code",
298+
silent=True,
299+
external=True,
300+
)
301+
session.run(
302+
"git",
303+
"diff",
304+
"--exit-code",
305+
silent=True,
306+
external=True,
307+
)
308+
except Exception:
309+
session.error("Cannot create a tag - there are uncommited changes")
310+
292311
if len(session.posargs) > 1:
293312
session.error("To many arguments")
294313

@@ -312,17 +331,6 @@ def tag(session: Session) -> None:
312331
# trigger npm install to update package-lock.json
313332
session.install("-e", ".")
314333

315-
try:
316-
session.run(
317-
"git",
318-
"diff",
319-
"--cached",
320-
"--exit-code",
321-
external=True,
322-
)
323-
except Exception:
324-
session.error("Cannot create a tag - there are uncommited changes")
325-
326334
version = get_version()
327335
install_requirements_file(session, "make-release")
328336
session.run("pysemver", "check", version)
@@ -339,15 +347,15 @@ def tag(session: Session) -> None:
339347
)
340348

341349
if session.interactive:
342-
response = input("confirm (yes/no): ").lower()
350+
response = input("Confirm (yes/no): ").lower()
343351
if response != "yes":
344-
return None
352+
session.error("Did not create tag")
345353

346354
# stage, commit, tag, and push version bump
347-
session.run("git", "add", "--all")
348-
session.run("git", "commit", "-m", repr(f"update version to {new_version}"))
355+
session.run("git", "add", "--all", external=True)
356+
session.run("git", "commit", "-m", repr(f"version {new_version}"), external=True)
349357
session.run("git", "tag", version, external=True)
350-
session.run("git", "push", "--tags", external=True)
358+
session.run("git", "push", "origin", "main", "--tags", external=True)
351359

352360

353361
@nox.session(reuse_venv=True)

0 commit comments

Comments
 (0)