Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ PYTHONPATH=scripts python3 -m czdev --help
| `czdev logout` | Remove the stored GitHub credentials. |
| `czdev bump [--deb PATH]` | Print the next patch version for a package (reads the version from the `.deb`). Defaults to `./build/*.deb`. |
| `czdev publish [--deb PATH]` | Validate the `.deb` and open a publish PR against the `packages` repo. Defaults to `./build/*.deb`. |
| `czdev publish --meta-only` | Update only the store listing (the `store` section of `app-builder.json`, screenshots, icon) of an already-published package, without a new `.deb` or version. Merges automatically once ownership and the metadata policy pass. |
| `czdev unpublish NAME --version V [--arch arm64]` | Open a PR that removes a published package version. |

### Ownership model
Expand Down
10 changes: 8 additions & 2 deletions scripts/czdev/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def main():
# publish
pub_parser = subparsers.add_parser("publish", help="Publish a .deb package to the CardputerZero app store.")
pub_parser.add_argument("--deb", default=None, help="Path to .deb file. If omitted, searches ./build/*.deb")
pub_parser.add_argument("--meta-only", action="store_true",
help="Only update the store listing (app-builder.json store section, screenshots, icon); no new .deb.")

# unpublish
unpub_parser = subparsers.add_parser("unpublish", help="Create a PR to remove a published package.")
Expand Down Expand Up @@ -66,8 +68,12 @@ def main():
from .bump import run
run(deb=args.deb)
elif args.command == "publish":
from .publish import run
run(deb=args.deb)
if args.meta_only:
from .publish import run_meta_only
run_meta_only()
else:
from .publish import run
run(deb=args.deb)
elif args.command == "unpublish":
from .unpublish import run
run(package=args.package, version=args.version, arch=args.arch)
Expand Down
14 changes: 2 additions & 12 deletions scripts/czdev/bump.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""Show next version (patch bump) for a package — mirrors the Rust bump module."""

import re
import subprocess
import sys
import urllib.request
from pathlib import Path
from typing import Optional

from .versions import compare_versions

PACKAGES_INDEX_URL = "https://cardputerzero.github.io/packages/dists/stable/main/binary-arm64/Packages"


Expand Down Expand Up @@ -101,14 +102,3 @@ def bump_patch(version: str) -> str:
except ValueError:
patch = 0
return f"{parts[0]}.{parts[1]}.{patch + 1}"


def compare_versions(a: str, b: str) -> int:
def parse(v):
return [int(x) for x in re.split(r'[.\-~]', v) if x.isdigit()]
pa, pb = parse(a), parse(b)
if pa > pb:
return 1
elif pa < pb:
return -1
return 0
Loading
Loading