Skip to content

Commit

Permalink
2.0.2 - Improve release task
Browse files Browse the repository at this point in the history
  • Loading branch information
vkottler committed Jul 6, 2024
1 parent 652981d commit f4223b7
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 22 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
GITHUB_API_TOKEN: ${{secrets.API_TOKEN}}
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}

jobs:
build:
Expand Down Expand Up @@ -49,29 +50,33 @@ jobs:

- run: mk docs
if: |
matrix.python-version == '3.11'
matrix.python-version == '3.12'
&& matrix.system == 'ubuntu-latest'
- run: mk python-test
env:
PY_TEST_EXTRA_ARGS: --cov-report=xml

- uses: codecov/codecov-action@v3.1.5
with:
fail_ci_if_error: true
verbose: true
token: ${{secrets.CODECOV_TOKEN}}

- run: mk pypi-upload-ci
env:
TWINE_USERNAME: __token__
if: |
matrix.python-version == '3.11'
matrix.python-version == '3.12'
&& matrix.system == 'ubuntu-latest'
&& env.TWINE_PASSWORD != ''
&& github.ref_name == 'master'
- run: |
mk python-release owner=vkottler \
repo=vmklib version=2.0.1
repo=vmklib version=2.0.2
if: |
matrix.python-version == '3.11'
matrix.python-version == '3.12'
&& matrix.system == 'ubuntu-latest'
&& env.GITHUB_API_TOKEN != ''
&& github.ref_name == 'master'
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
=====================================
generator=datazen
version=3.1.4
hash=68e3174cbaf5e937620f00c5fe69e651
hash=fcfed0c41e658545e35e4948bff221a8
=====================================
-->

# vmklib ([2.0.1](https://pypi.org/project/vmklib/))
# vmklib ([2.0.2](https://pypi.org/project/vmklib/))

[![python](https://img.shields.io/pypi/pyversions/vmklib.svg)](https://pypi.org/project/vmklib/)
![Build Status](https://github.com/vkottler/vmklib/workflows/Python%20Package/badge.svg)
Expand Down
2 changes: 1 addition & 1 deletion local/variables/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
major: 2
minor: 0
patch: 1
patch: 2
entry: mk
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"

[project]
name = "vmklib"
version = "2.0.1"
version = "2.0.2"
description = "Simplify project workflows by standardizing use of GNU Make."
readme = "README.md"
requires-python = ">=3.10"
Expand Down
5 changes: 3 additions & 2 deletions tests/test_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

# built-in
from contextlib import ExitStack, contextmanager
from contextlib import ExitStack, contextmanager, suppress
from multiprocessing import Process
import os
import signal
Expand Down Expand Up @@ -32,7 +32,8 @@ def test_interrupt():
proc.start()
time.sleep(0.5)
assert isinstance(proc.pid, int)
os.kill(proc.pid, signal.SIGINT)
with suppress(PermissionError):
os.kill(proc.pid, signal.SIGINT)
proc.join()


Expand Down
4 changes: 2 additions & 2 deletions vmklib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =====================================
# generator=datazen
# version=3.1.4
# hash=0b06924a9490f122f646f491d43e5fd6
# hash=a189f4011428578af1bb711f90f3f283
# =====================================

"""
Expand All @@ -10,4 +10,4 @@

DESCRIPTION = "Simplify project workflows by standardizing use of GNU Make."
PKG_NAME = "vmklib"
VERSION = "2.0.1"
VERSION = "2.0.2"
26 changes: 17 additions & 9 deletions vmklib/tasks/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,29 @@ async def release(
"generate_release_notes": True,
},
)

self.log.info("Create-release result: '%s'.", result)

if "message" in result and result["message"] == "Validation Failed":
self.log.warning("Release at current version already exists.")
return True

release_id = result["id"]
success = False

# Use 'Upload a release asset' API to upload all files in the 'dist'
# directory to the new release.
for item in cwd.joinpath(dist).iterdir():
result = await self.upload_release_asset(
owner, repo, release_id, item
)
self.log.info("Uploaded '%s'.", result["browser_download_url"])
if "id" in result:
release_id = result["id"]

# Use 'Upload a release asset' API to upload all files in the
# 'dist' directory to the new release.
for item in cwd.joinpath(dist).iterdir():
result = await self.upload_release_asset(
owner, repo, release_id, item
)
self.log.info("Uploaded '%s'.", result["browser_download_url"])

success = True

return True
return success

async def run(
self,
Expand Down

0 comments on commit f4223b7

Please sign in to comment.