Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
nightly_manifest Namespace Reference

Functions

 build_rank (name, uploaded)
 
 api (path, token)
 
 sha256_of_url (url)
 
 docker_entry ()
 
 api_raw (url)
 
 build_manifest (token, with_hashes=True)
 
 render_cask (manifest)
 
 render_scoop (manifest)
 
 render_summary (manifest)
 
 check (manifest)
 
 render_oneline (manifest)
 
 main ()
 

Variables

str REPO = "aurelienpierreeng/ansel"
 
str API = "https://api.github.com"
 
str DOCKER_IMAGE = "aurelienpierre/ansel"
 
str DOCKER_HUB = "https://hub.docker.com/v2/repositories"
 
 TAG_RE = re.compile(r"^nightly-\d{4}-\d{2}$")
 
dict FORMATS
 
 VERSION_RE = re.compile(r"^[Aa]nsel-(?P<version>[0-9][^-]*?\.g(?P<hash>[0-9a-f]+))-")
 
 COMMITS_RE = re.compile(r"\+(\d+)[.~]g")
 
 VERSION_TAG_RE = re.compile(r"^[0-9][^-]*-\d+\.g(?P<hash>[0-9a-f]+)$")
 

Detailed Description

The nightly manifest: one JSON file naming the newest build of every format.

Everything downstream of the nightly builds reads this file instead of the GitHub
API: the website's download buttons, the in-app update check, the Homebrew cask and
the Scoop manifest. That is the point of it -- one place that knows what "latest"
means, written once per night by CI, served as a static file with no rate limit and
no dependency on GitHub being reachable from a user's machine.

    nightly_manifest.py manifest  > nightly.json     # from the GitHub releases
    nightly_manifest.py cask   nightly.json          # Homebrew cask (stdout)
    nightly_manifest.py scoop  nightly.json          # Scoop manifest (stdout)

The manifest walks the `nightly-YYYY-MM` pre-releases newest first and takes, per
format, the most recently uploaded asset. Formats are recognised by filename shape,
which is also what the running application matches itself against (see
src/common/updates.c), so the two must agree: change one, change the other.

sha256 is computed by downloading each asset. GitHub's API started publishing a
`digest` for release assets in 2025, and it is used when present; the download is the
fallback that keeps the manifest complete on assets uploaded before that.

Function Documentation

◆ api()

nightly_manifest.api (   path,
  token 
)

Definition at line 83 of file nightly_manifest.py.

Referenced by build_manifest().

◆ api_raw()

nightly_manifest.api_raw (   url)

Definition at line 131 of file nightly_manifest.py.

Referenced by docker_entry().

◆ build_manifest()

nightly_manifest.build_manifest (   token,
  with_hashes = True 
)

Definition at line 137 of file nightly_manifest.py.

References api(), build_rank(), docker_entry(), and sha256_of_url().

Referenced by main().

◆ build_rank()

nightly_manifest.build_rank (   name,
  uploaded 
)
Sort key for "newest": commit count first, upload time to break ties.

Definition at line 74 of file nightly_manifest.py.

Referenced by build_manifest().

◆ check()

nightly_manifest.check (   manifest)
Exit status 0 when the manifest names at least one build, 1 when it is empty.

The workflow gates publishing on this: an empty manifest -- no nightly-* release
yet, or a GitHub API hiccup that returned nothing -- must never overwrite a good
file downstream. The first run on master did exactly that to the website's data
file before this existed.

Definition at line 299 of file nightly_manifest.py.

Referenced by main().

◆ docker_entry()

nightly_manifest.docker_entry ( )
The newest versioned tag on Docker Hub, or None if the image has no such tag yet.

The workflow tags each push twice, `current` and the version string; `current` is
what a user pulls, the version tag is what tells us which nightly it is. Sorted by
push time rather than by name so a re-push of an older version cannot win.

Definition at line 102 of file nightly_manifest.py.

References api_raw(), and max.

Referenced by build_manifest().

◆ main()

nightly_manifest.main ( void  )

Definition at line 315 of file nightly_manifest.py.

References build_manifest(), check(), and main().

Referenced by main().

◆ render_cask()

nightly_manifest.render_cask (   manifest)

Definition at line 213 of file nightly_manifest.py.

◆ render_oneline()

nightly_manifest.render_oneline (   manifest)
One line for a commit message: `appimage 0.0.0+4810.g..., exe 0.0.0+4810.g...`.

Definition at line 309 of file nightly_manifest.py.

◆ render_scoop()

nightly_manifest.render_scoop (   manifest)

Definition at line 263 of file nightly_manifest.py.

◆ render_summary()

nightly_manifest.render_summary (   manifest)
A table for the run summary, one line per format; says so when there is none.

Definition at line 290 of file nightly_manifest.py.

◆ sha256_of_url()

nightly_manifest.sha256_of_url (   url)

Definition at line 93 of file nightly_manifest.py.

Referenced by build_manifest().

Variable Documentation

◆ API

str nightly_manifest.API = "https://api.github.com"

Definition at line 50 of file nightly_manifest.py.

◆ COMMITS_RE

nightly_manifest.COMMITS_RE = re.compile(r"\+(\d+)[.~]g")

Definition at line 71 of file nightly_manifest.py.

◆ DOCKER_HUB

str nightly_manifest.DOCKER_HUB = "https://hub.docker.com/v2/repositories"

Definition at line 52 of file nightly_manifest.py.

◆ DOCKER_IMAGE

str nightly_manifest.DOCKER_IMAGE = "aurelienpierre/ansel"

Definition at line 51 of file nightly_manifest.py.

◆ FORMATS

dict nightly_manifest.FORMATS
Initial value:
1= {
2 "appimage": lambda n: n.endswith("-x86_64.AppImage"),
3 "flatpak": lambda n: n.endswith("-x86_64.flatpak"),
4 "dmg-arm64": lambda n: n.endswith("-arm64.dmg"),
5 "dmg-i386": lambda n: n.endswith("-i386.dmg"),
6 "exe": lambda n: n.endswith("-win64.exe"),
7 # `docker save | zstd` of the image the same night pushed to Docker Hub.
8 "docker": lambda n: n.endswith("-docker.tar.zst"),
9}

Definition at line 57 of file nightly_manifest.py.

◆ REPO

str nightly_manifest.REPO = "aurelienpierreeng/ansel"

Definition at line 49 of file nightly_manifest.py.

◆ TAG_RE

nightly_manifest.TAG_RE = re.compile(r"^nightly-\d{4}-\d{2}$")

Definition at line 53 of file nightly_manifest.py.

◆ VERSION_RE

nightly_manifest.VERSION_RE = re.compile(r"^[Aa]nsel-(?P<version>[0-9][^-]*?\.g(?P<hash>[0-9a-f]+))-")

Definition at line 68 of file nightly_manifest.py.

◆ VERSION_TAG_RE

nightly_manifest.VERSION_TAG_RE = re.compile(r"^[0-9][^-]*-\d+\.g(?P<hash>[0-9a-f]+)$")

Definition at line 80 of file nightly_manifest.py.